Skip to content

Commit

Permalink
Merge m-c to inbound, a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 7VZH3r52Gc7
  • Loading branch information
KWierso committed Sep 19, 2017
2 parents d43e6a9 + 6f940b2 commit 5367eb6
Show file tree
Hide file tree
Showing 316 changed files with 12,364 additions and 12,912 deletions.
2 changes: 2 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,8 @@ pref("browser.newtabpage.activity-stream.enabled", true);
pref("browser.newtabpage.activity-stream.prerender", true);
pref("browser.newtabpage.activity-stream.aboutHome.enabled", true);

pref("browser.library.activity-stream.enabled", true);

// Enable the DOM fullscreen API.
pref("full-screen-api.enabled", true);

Expand Down
56 changes: 32 additions & 24 deletions browser/base/content/aboutNetError.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@

function initPage() {
var err = getErrorCode();
// List of error pages with an illustration.
let illustratedErrors = ["malformedURI"];
if (illustratedErrors.includes(err)) {
document.body.classList.add("illustrated", err);
}

gIsCertError = (err == "nssBadCert");
// Only worry about captive portals if this is a cert error.
let showCaptivePortalUI = isCaptive() && gIsCertError;
Expand Down Expand Up @@ -199,7 +205,7 @@
}
addAutofocus("errorTryAgain");

document.body.className = "neterror";
document.body.classList.add("neterror");

var ld = document.getElementById("errorLongDesc");
if (ld) {
Expand Down Expand Up @@ -522,7 +528,7 @@
<h1 id="et_dnsNotFound">&dnsNotFound.title;</h1>
<h1 id="et_fileNotFound">&fileNotFound.title;</h1>
<h1 id="et_fileAccessDenied">&fileAccessDenied.title;</h1>
<h1 id="et_malformedURI">&malformedURI.title;</h1>
<h1 id="et_malformedURI">&malformedURI.title1;</h1>
<h1 id="et_unknownProtocolFound">&unknownProtocolFound.title;</h1>
<h1 id="et_connectionFailure">&connectionFailure.title;</h1>
<h1 id="et_netTimeout">&netTimeout.title;</h1>
Expand Down Expand Up @@ -551,7 +557,7 @@
<div id="ed_dnsNotFound">&dnsNotFound.longDesc;</div>
<div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
<div id="ed_fileAccessDenied">&fileAccessDenied.longDesc;</div>
<div id="ed_malformedURI">&malformedURI.longDesc;</div>
<div id="ed_malformedURI"></div>
<div id="ed_unknownProtocolFound">&unknownProtocolFound.longDesc;</div>
<div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
<div id="ed_netTimeout">&netTimeout.longDesc;</div>
Expand All @@ -578,33 +584,35 @@

<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer" class="container">
<!-- Error Title -->
<div class="title">
<h1 class="title-text"/>
</div>
<div id="text-container">
<!-- Error Title -->
<div class="title">
<h1 class="title-text"/>
</div>

<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">

<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
</div>
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation;</p>
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
</div>
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation;</p>

<div id="wrongSystemTimePanel" style="display: none;">
&certerror.wrongSystemTime2;
</div>
<div id="wrongSystemTimePanel" style="display: none;">
&certerror.wrongSystemTime2;
</div>

<div id="wrongSystemTimeWithoutReferencePanel" style="display: none;">
&certerror.wrongSystemTimeWithoutReference;
</div>
<div id="wrongSystemTimeWithoutReferencePanel" style="display: none;">
&certerror.wrongSystemTimeWithoutReference;
</div>

<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc" />
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc" />

<div id="learnMoreContainer">
<p><a href="https://support.mozilla.org/kb/what-does-your-connection-is-not-secure-mean" id="learnMoreLink" target="new">&errorReporting.learnMore;</a></p>
<div id="learnMoreContainer">
<p><a href="https://support.mozilla.org/kb/what-does-your-connection-is-not-secure-mean" id="learnMoreLink" target="new">&errorReporting.learnMore;</a></p>
</div>
</div>

<!-- UI for option to report certificate errors to Mozilla. Removed on
Expand Down
1 change: 1 addition & 0 deletions browser/base/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
#appMenu_historyMenu > .bookmark-item,
#appMenu-library-recentlyClosedTabs > .panel-subview-body > .bookmark-item,
#appMenu-library-recentlyClosedWindows > .panel-subview-body > .bookmark-item,
#appMenu-library-recentHighlights > .bookmark-item,
#panelMenu_bookmarksMenu > .bookmark-item {
max-width: none;
}
Expand Down
58 changes: 58 additions & 0 deletions browser/base/content/illustrations/error-malformed-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 77 additions & 11 deletions browser/base/content/test/general/browser_discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,26 @@ var iconDiscoveryTests = [
];

function runIconDiscoveryTest() {
var testCase = iconDiscoveryTests[0];
var head = doc().getElementById("linkparent");
var hasSrc = gBrowser.getIcon() != null;
if (testCase.pass)
ok(hasSrc, testCase.text);
else
ok(!hasSrc, testCase.text);

head.removeChild(head.getElementsByTagName("link")[0]);
iconDiscoveryTests.shift();
iconDiscovery(); // Run the next test.
let testCase = iconDiscoveryTests[0];
let head = doc().getElementById("linkparent");

// Because there is debounce logic in ContentLinkHandler.jsm to reduce the
// favicon loads, we have to wait some time before checking that icon was
// stored properly.
BrowserTestUtils.waitForCondition(() => {
return gBrowser.getIcon() != null;
}, "wait for icon load to finish", 100, 5)
.then(() => {
ok(testCase.pass, testCase.text);
})
.catch(() => {
ok(!testCase.pass, testCase.text);
})
.then(() => {
head.removeChild(head.getElementsByTagName("link")[0]);
iconDiscoveryTests.shift();
iconDiscovery(); // Run the next test.
});
}

function iconDiscovery() {
Expand All @@ -64,6 +73,63 @@ function iconDiscovery() {
if (testCase.pass == undefined)
testCase.pass = true;

link.rel = rel;
link.href = href;
link.type = type;
head.appendChild(link);
} else {
richIconDiscovery();
}
}

let richIconDiscoveryTests = [
{ rel: "apple-touch-icon", text: "apple-touch-icon discovered" },
{ rel: "apple-touch-icon-precomposed", text: "apple-touch-icon-precomposed discovered" },
{ rel: "fluid-icon", text: "fluid-icon discovered" },
{ rel: "unknown-icon", pass: false, text: "unknown icon not discovered" }
];

function runRichIconDiscoveryTest() {
let testCase = richIconDiscoveryTests[0];
let head = doc().getElementById("linkparent");

// Because there is debounce logic in ContentLinkHandler.jsm to reduce the
// favicon loads, we have to wait some time before checking that icon was
// stored properly.
BrowserTestUtils.waitForCondition(() => {
return gBrowser.getIcon() != null;
}, "wait for icon load to finish", 100, 5)
.then(() => {
ok(testCase.pass, testCase.text);
})
.catch(() => {
ok(!testCase.pass, testCase.text);
})
.then(() => {
head.removeChild(head.getElementsByTagName("link")[0]);
richIconDiscoveryTests.shift();
richIconDiscovery(); // Run the next test.
});
}

function richIconDiscovery() {
if (richIconDiscoveryTests.length) {
setHandlerFunc(runRichIconDiscoveryTest);
gBrowser.setIcon(gBrowser.selectedTab, null,
Services.scriptSecurityManager.getSystemPrincipal()
);

let testCase = richIconDiscoveryTests[0];
let head = doc().getElementById("linkparent");
let link = doc().createElement("link");

let rel = testCase.rel;
let rootDir = getRootDirectory(gTestPath);
let href = testCase.href || rootDir + "moz.png";
let type = testCase.type || "image/png";
if (testCase.pass === undefined)
testCase.pass = true;

link.rel = rel;
link.href = href;
link.type = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,44 @@

const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html"

/*
* This test tests a link element won't fire DOMLinkChanged/DOMLinkAdded unless
* it is added to the DOM. See more details in bug 1083895.
*
* Note that there is debounce logic in ContentLinkHandler.jsm, adding a new
* icon link after the icon parsing timeout will trigger a new icon extraction
* cycle. Hence, there should be two favicons loads in this test as it appends
* a new link to the DOM in the timeout callback defined in the test HTML page.
* However, the not-yet-added link element with href as "http://example.org/other-icon"
* should not fire the DOMLinkAdded event, nor should it fire the DOMLinkChanged
* event after its href gets updated later.
*/
add_task(async function() {
let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
let tabLoaded = promiseTabLoaded(extraTab);
let domLinkAddedFired = 0;
let domLinkChangedFired = 0;
const linkAddedHandler = event => domLinkAddedFired++;
const linkChangedhandler = event => domLinkChangedFired++;
gBrowser.addEventListener("DOMLinkAdded", linkAddedHandler);
gBrowser.addEventListener("DOMLinkChanged", linkChangedhandler);
extraTab.linkedBrowser.loadURI(TEST_URL);
let expectedFavicon = "http://example.org/one-icon";
let haveChanged = PromiseUtils.defer();
let observer = new MutationObserver(function(mutations) {
for (let mut of mutations) {
if (mut.attributeName != "image") {
continue;
}
let imageVal = extraTab.getAttribute("image").replace(/#.*$/, "");
if (!imageVal) {
// The value gets removed because it doesn't load.
continue;
}
is(imageVal, expectedFavicon, "Favicon image should correspond to expected image.");
haveChanged.resolve();
}
});
observer.observe(extraTab, {attributes: true});
await tabLoaded;
expectedFavicon = "http://example.org/yet-another-icon";
haveChanged = PromiseUtils.defer();
await haveChanged.promise;
observer.disconnect();
gBrowser.removeTab(extraTab);
});
let expectedFavicon = "http://example.org/yet-another-icon";
await promiseTabLoaded(extraTab);

// Make sure the new added favicon link gets loaded.
try {
await BrowserTestUtils.waitForCondition(() => {
return gBrowser.getIcon(extraTab) === expectedFavicon;
}, "wait for favicon load to finish", 1000, 5);
ok(true, "Should load the added favicon");
} catch (e) {
ok(false, "Should've loaded the new added favicon.");
}

is(domLinkAddedFired, 2, "Should fire the correct number of DOMLinkAdded event.");
is(domLinkChangedFired, 0, "Should not fire any DOMLinkChanged event.");

gBrowser.removeEventListener("DOMLinkAdded", linkAddedHandler);
gBrowser.removeEventListener("DOMLinkChanged", linkChangedhandler);
gBrowser.removeTab(extraTab);
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ function test() {

tab.linkedBrowser.addEventListener("load", function() {
let expectedIcon = testPath + "file_bug970276_favicon1.ico";
is(gBrowser.getIcon(tab), expectedIcon, "Correct icon.");
let icon;

gBrowser.removeTab(tab);

finish();
// Because there is debounce logic in ContentLinkHandler.jsm to reduce the
// favicon loads, we have to wait some time before checking that icon was
// stored properly.
BrowserTestUtils.waitForCondition(() => {
icon = gBrowser.getIcon(tab);
return icon != null;
}, "wait for favicon load to finish", 100, 5)
.then(() => {
is(icon, expectedIcon, "Correct icon.");
})
.catch(() => {
ok(false, "Can't get the correct icon.");
})
.then(() => {
gBrowser.removeTab(tab);
finish();
});
}, {capture: true, once: true});
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ requestLongerTimeout(5);
/* These reflows happen only the first time the awesomebar panel opens. */
const EXPECTED_REFLOWS_FIRST_OPEN = [
// Bug 1357054
{
stack: [
"_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
"handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
"_onChanged@chrome://global/content/bindings/autocomplete.xml",
"_appendCurrentResult/<@chrome://global/content/bindings/autocomplete.xml",
"setTimeout handler*_appendCurrentResult@chrome://global/content/bindings/autocomplete.xml",
"_invalidate@chrome://global/content/bindings/autocomplete.xml",
"invalidate@chrome://global/content/bindings/autocomplete.xml"
],
times: 18, // This number should only ever go down - never up.
},

{
stack: [
"_rebuild@chrome://browser/content/search/search.xml",
Expand Down Expand Up @@ -54,8 +67,10 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
stack: [
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
"_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
"setTimeout handler*_invalidate@chrome://global/content/bindings/autocomplete.xml",
"invalidate@chrome://global/content/bindings/autocomplete.xml",
],
times: 36, // This number should only ever go down - never up.
times: 51, // This number should only ever go down - never up.
},

{
Expand All @@ -67,17 +82,7 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
"_invalidate@chrome://global/content/bindings/autocomplete.xml",
"invalidate@chrome://global/content/bindings/autocomplete.xml"
],
times: 1344, // This number should only ever go down - never up.
},

{
stack: [
"_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
"handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
"_onChanged@chrome://global/content/bindings/autocomplete.xml",
"_appendCurrentResult/<@chrome://global/content/bindings/autocomplete.xml",
],
times: 6,
times: 60, // This number should only ever go down - never up.
},

{
Expand Down
Loading

0 comments on commit 5367eb6

Please sign in to comment.