Skip to content

Commit

Permalink
Merge m-c to b2g-inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Oct 17, 2014
2 parents 2f31b99 + 52e3fb3 commit 43bd800
Show file tree
Hide file tree
Showing 215 changed files with 4,171 additions and 2,209 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 1061335 - CLOBBER for Win32 compiler update.
Bug 609976 - CLOBBER
12 changes: 10 additions & 2 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,15 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
notification.persistence = 1;
};

gDNSService.asyncResolve(hostName, 0, onLookupComplete, Services.tm.mainThread);
try {
gDNSService.asyncResolve(hostName, 0, onLookupComplete, Services.tm.mainThread);
} catch (ex) {
// Do nothing if the URL is invalid (we don't want to show a notification in that case).
if (ex.result != Cr.NS_ERROR_UNKNOWN_HOST) {
// ... otherwise, report:
Cu.reportError(ex);
}
}
}

// Called when a docshell has attempted to load a page in an incorrect process.
Expand Down Expand Up @@ -6503,7 +6511,7 @@ var gIdentityHandler = {

// Chrome URIs however get special treatment. Some chrome URIs are
// whitelisted to provide a positive security signal to the user.
let whitelist = /^about:(accounts|addons|app-manager|config|crashes|customizing|healthreport|home|newaddon|permissions|preferences|privatebrowsing|sessionrestore|support|welcomeback)/i;
let whitelist = /^about:(accounts|addons|app-manager|config|crashes|customizing|healthreport|home|license|newaddon|permissions|preferences|privatebrowsing|rights|sessionrestore|support|welcomeback)/i;
let isChromeUI = uri.schemeIs("about") && whitelist.test(uri.spec);
if (isChromeUI) {
this.setMode(this.IDENTITY_MODE_CHROMEUI);
Expand Down
10 changes: 10 additions & 0 deletions browser/base/content/tabbrowser.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,13 @@ tabpanels {
browser[pending] {
display: none;
}

browser[pendingpaint] {
opacity: 0;
}

tabbrowser[pendingpaint] {
background-image: url(chrome://global/skin/spinner.png);
background-repeat: no-repeat;
background-position: center center;
}
36 changes: 34 additions & 2 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
""
</field>

<field name="_contentWaitingCount">
0
</field>

<property name="_numPinnedTabs" readonly="true">
<getter><![CDATA[
for (var i = 0; i < this.tabs.length; i++) {
Expand Down Expand Up @@ -3228,6 +3232,31 @@
</body>
</method>

<method name="_showBusySpinnerRemoteBrowser">
<parameter name="aBrowser"/>
<body><![CDATA[
aBrowser.setAttribute("pendingpaint", "true");
if (this._contentWaitingCount <= 0) {
// We are not currently spinning
this.setAttribute("pendingpaint", "true");
this._contentWaitingCount = 1;
} else {
this._contentWaitingCount++;
}
]]></body>
</method>

<method name="_hideBusySpinnerRemoteBrowser">
<parameter name="aBrowser"/>
<body><![CDATA[
aBrowser.removeAttribute("pendingpaint");
this._contentWaitingCount--;
if (this._contentWaitingCount <= 0) {
this.removeAttribute("pendingpaint");
}
]]></body>
</method>

<method name="_prepareForTabSwitch">
<parameter name="toTab"/>
<parameter name="fromTab"/>
Expand Down Expand Up @@ -3266,16 +3295,19 @@
let timeoutPromise = new Promise((aResolve, aReject) => {
timeoutId = setTimeout(() => {
this._showBusySpinnerRemoteBrowser(toBrowser);
attemptTabSwitch(aResolve, aReject);
}, kTabSwitchTimeout);
});
let paintPromise = new Promise((aResolve, aReject) => {
toBrowser.addEventListener("MozAfterRemotePaint", function onRemotePaint() {
let onRemotePaint = () => {
toBrowser.removeEventListener("MozAfterRemotePaint", onRemotePaint);
this._hideBusySpinnerRemoteBrowser(toBrowser);
clearTimeout(timeoutId);
attemptTabSwitch(aResolve, aReject);
});
};
toBrowser.addEventListener("MozAfterRemotePaint", onRemotePaint);
toBrowser.QueryInterface(Ci.nsIFrameLoaderOwner)
.frameLoader
.requestNotifyAfterRemotePaint();
Expand Down
3 changes: 3 additions & 0 deletions browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ support-files =
file_dom_notifications.html
file_double_close_tab.html
file_favicon_change.html
file_favicon_change_not_in_document.html
file_fullscreen-window-open.html
get_user_media.html
head.js
Expand Down Expand Up @@ -324,6 +325,8 @@ skip-if = e10s
skip-if = true # browser_drag.js is disabled, as it needs to be updated for the new behavior from bug 320638.
[browser_favicon_change.js]
skip-if = e10s
[browser_favicon_change_not_in_document.js]
skip-if = e10s
[browser_findbarClose.js]
skip-if = e10s # Bug ?????? - test directly manipulates content (tries to grab an iframe directly from content)
[browser_fullscreen-window-open.js]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

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

add_task(function*() {
let extraTab = gBrowser.selectedTab = gBrowser.addTab();
let tabLoaded = promiseTabLoaded(extraTab);
extraTab.linkedBrowser.loadURI(TEST_URL);
let expectedFavicon = "http://example.org/one-icon";
let haveChanged = new Promise.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});
yield tabLoaded;
expectedFavicon = "http://example.org/yet-another-icon";
haveChanged = new Promise.defer();
yield haveChanged.promise;
observer.disconnect();
gBrowser.removeTab(extraTab);
});


Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="icon" href="http://example.org/one-icon" type="image/ico" id="i">
</head>
<body onload="onload()">
<script>
function onload() {
var ico = document.createElement("link");
ico.setAttribute("rel", "icon");
ico.setAttribute("type", "image/ico");
ico.setAttribute("href", "http://example.org/other-icon");
setTimeout(function() {
ico.setAttribute("href", "http://example.org/yet-another-icon");
document.getElementById("i").remove();
document.head.appendChild(ico);
}, 1000);
}
</script>
</body></html>

13 changes: 8 additions & 5 deletions browser/components/loop/MozLoopAPI.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,18 @@ function injectLoopAPI(targetWindow) {
/**
* Composes an email via the external protocol service.
*
* @param {String} subject Subject of the email to send
* @param {String} body Body message of the email to send
* @param {String} subject Subject of the email to send
* @param {String} body Body message of the email to send
* @param {String} recipient Recipient email address (optional)
*/
composeEmail: {
enumerable: true,
writable: true,
value: function(subject, body) {
let mailtoURL = "mailto:?subject=" + encodeURIComponent(subject) + "&" +
"body=" + encodeURIComponent(body);
value: function(subject, body, recipient) {
recipient = recipient || "";
let mailtoURL = "mailto:" + encodeURIComponent(recipient) +
"?subject=" + encodeURIComponent(subject) +
"&body=" + encodeURIComponent(body);
extProtocolSvc.loadURI(CommonUtils.makeURI(mailtoURL));
}
},
Expand Down
Loading

0 comments on commit 43bd800

Please sign in to comment.