Skip to content

Commit

Permalink
Merge autoland to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoroiu committed Sep 30, 2019
2 parents e1e8ea1 + e10cc87 commit 678c78a
Show file tree
Hide file tree
Showing 78 changed files with 277 additions and 291 deletions.
1 change: 0 additions & 1 deletion browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

[DEFAULT]
prefs =
browser.cache.offline.insecure.enable=true
plugin.load_flash_only=false # for plugin usage in browser_tab_dragdrop.js
support-files =
alltabslistener.html
Expand Down
4 changes: 4 additions & 0 deletions browser/base/content/test/sanitize/browser_sanitizeDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ add_task(async function test_form_entries() {

// Test for offline cache deletion
add_task(async function test_offline_cache() {
Services.prefs.setBoolPref("browser.cache.offline.enable", true);
Services.prefs.setBoolPref("browser.cache.offline.storage.enable", true);
// Prepare stuff, we will work with www.example.com
var URL = "http://www.example.com";
var URI = makeURI(URL);
Expand Down Expand Up @@ -568,6 +570,8 @@ add_task(async function test_offline_cache() {
cacheListener
);
await wh.promiseClosed;
Services.prefs.clearUserPref("browser.cache.offline.enable");
Services.prefs.clearUserPref("browser.cache.offline.storage.enable");
});

// Test for offline apps permission deletion
Expand Down
2 changes: 1 addition & 1 deletion browser/components/preferences/in-content/preferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Additionally we should remove 'unsafe-inline' from style-src, see Bug 1579160 -->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
csp="default-src chrome:; script-src chrome: 'sha512-X8+p/CqXeMdssOoFOf5RV+RpkvnN9pukQ20acGc7LqMgfYLW+lR0WAYT66OtSTpFHE/Qgx/ZCBs2RMc4QrA8FQ=='; img-src chrome: moz-icon: https:; style-src chrome: data: 'unsafe-inline'; object-src 'none'"
csp="default-src chrome:; script-src chrome: 'sha512-X8+p/CqXeMdssOoFOf5RV+RpkvnN9pukQ20acGc7LqMgfYLW+lR0WAYT66OtSTpFHE/Qgx/ZCBs2RMc4QrA8FQ=='; img-src chrome: moz-icon: https: data:; style-src chrome: data: 'unsafe-inline'; object-src 'none'"
role="document"
data-l10n-id="pref-page"
data-l10n-attrs="title">
Expand Down
2 changes: 1 addition & 1 deletion browser/components/sessionstore/test/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ skip-if = fission || debug # bug 1211084
[browser_backup_recovery.js]
skip-if = (verify && debug && (os == 'linux'))
[browser_broadcast.js]
skip-if = (os == 'mac' && debug) # Bug 1533895
skip-if = (os == 'mac') || (os == 'linux' && !debug && bits == 64) # Bug 1533895
[browser_capabilities.js]
[browser_cleaner.js]
[browser_crashedTabs.js]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class InlinePreviewRow extends PureComponent<Props> {
{previews.map((preview: Preview) => (
<InlinePreview
line={line}
key={`${line}-${preview.name}`}
variable={preview.name}
value={preview.value}
openElementInInspector={openElementInInspector}
Expand Down
4 changes: 3 additions & 1 deletion docshell/base/BrowsingContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {

// Get the DocShell for this BrowsingContext if it is in-process, or
// null if it's not.
nsIDocShell* GetDocShell() { return mDocShell; }
nsIDocShell* GetDocShell() const { return mDocShell; }
void SetDocShell(nsIDocShell* aDocShell);
void ClearDocShell() { mDocShell = nullptr; }

Expand Down Expand Up @@ -204,6 +204,8 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {

bool IsTopContent() const { return IsContent() && !GetParent(); }

bool IsContentSubframe() const { return IsContent() && GetParent(); }

uint64_t Id() const { return mBrowsingContextId; }

BrowsingContext* GetParent() const { return mParent; }
Expand Down
18 changes: 11 additions & 7 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2133,10 +2133,12 @@ nsDocShell::HistoryPurged(int32_t aNumEntries) {
void nsDocShell::TriggerParentCheckDocShellIsEmpty() {
if (RefPtr<nsDocShell> parent = GetInProcessParentDocshell()) {
parent->DocLoaderIsEmpty(true);
} else if (BrowserChild* browserChild = BrowserChild::GetFrom(this)) {
// OOP parent
mozilla::Unused << browserChild->SendMaybeFireEmbedderLoadEvents(
/*aIsTrusted*/ true, /*aFireLoadAtEmbeddingElement*/ false);
}
if (GetBrowsingContext()->IsContentSubframe() && !GetBrowsingContext()->GetParent()->IsInProcess()) {
if (BrowserChild* browserChild = BrowserChild::GetFrom(this)) {
mozilla::Unused << browserChild->SendMaybeFireEmbedderLoadEvents(
/*aIsTrusted*/ true, /*aFireLoadAtEmbeddingElement*/ false);
}
}
}

Expand Down Expand Up @@ -3964,9 +3966,11 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
// because error documents do not result in a call to
// SendMaybeFireEmbedderLoadEvents via any of the normal call paths.
// (Obviously, we must do this before any of the returns below.)
if (BrowserChild* browserChild = BrowserChild::GetFrom(this)) {
mozilla::Unused << browserChild->SendMaybeFireEmbedderLoadEvents(
/*aIsTrusted*/ true, /*aFireLoadAtEmbeddingElement*/ false);
if (GetBrowsingContext()->IsContentSubframe() && !GetBrowsingContext()->GetParent()->IsInProcess()) {
if (BrowserChild* browserChild = BrowserChild::GetFrom(this)) {
mozilla::Unused << browserChild->SendMaybeFireEmbedderLoadEvents(
/*aIsTrusted*/ true, /*aFireLoadAtEmbeddingElement*/ false);
}
}

*aDisplayedErrorPage = false;
Expand Down
3 changes: 1 addition & 2 deletions dom/base/nsGlobalWindowInner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2963,8 +2963,7 @@ bool nsGlobalWindowInner::IsPrivilegedChromeWindow(JSContext* aCx,
/* static */
bool nsGlobalWindowInner::OfflineCacheAllowedForContext(JSContext* aCx,
JSObject* aObj) {
return IsSecureContextOrObjectIsFromSecureContext(aCx, aObj) ||
Preferences::GetBool("browser.cache.offline.insecure.enable");
return IsSecureContextOrObjectIsFromSecureContext(aCx, aObj);
}

/* static */
Expand Down
21 changes: 12 additions & 9 deletions dom/events/IMEContentObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1680,23 +1680,26 @@ IMEContentObserver::IMENotificationSender::Run() {
if (observer->mNeedsToNotifyIMEOfTextChange) {
observer->mNeedsToNotifyIMEOfTextChange = false;
SendTextChange();
// Even if the observer hasn't received selection change, let's try to send
// selection change notification to IME because selection start offset may
// be changed if the previous contents of selection start are changed. For
// example, when previous `<p>` element of another `<p>` element which
// contains caret is removed by a DOM mutation, selection change event
// won't be fired, but selection start offset should be decreased by the
// length of removed `<p>` element.
observer->mNeedsToNotifyIMEOfSelectionChange = true;
}

// If a text change notification causes another text change again, we should
// notify IME of that before sending a selection change notification.
// Otherwise, even if the observer hasn't received selection change, let's
// try to send selection change notification to IME because selection
// start offset may be changed if the previous contents of selection start
// are changed. For example, when previous `<p>` element of another `<p>`
// element which contains caret is removed by a DOM mutation, selection
// change event won't be fired, but selection start offset should be
// decreased by the length of removed `<p>` element.
if (!observer->mNeedsToNotifyIMEOfTextChange) {
// Be aware, PuppetWidget depends on the order of this. A selection change
// notification should not be sent before a text change notification because
// PuppetWidget shouldn't query new text content every selection change.
observer->mNeedsToNotifyIMEOfSelectionChange = false;
SendSelectionChange();
if (observer->mNeedsToNotifyIMEOfSelectionChange) {
observer->mNeedsToNotifyIMEOfSelectionChange = false;
SendSelectionChange();
}
}

// If a text change notification causes another text change again or a
Expand Down
121 changes: 0 additions & 121 deletions dom/tests/mochitest/ajax/offline/browser_disableAppcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,135 +2,14 @@ const PATH =
"http://example.com/browser/dom/tests/mochitest/ajax/offline/";
const URL = PATH + "file_simpleManifest.html";
const MANIFEST = PATH + "file_simpleManifest.cacheManifest";
const PREF_INSECURE_APPCACHE = "browser.cache.offline.insecure.enable";
const PREF_NETWORK_PROXY = "network.proxy.type";

function setSJSState(sjsPath, stateQuery) {
let client = new XMLHttpRequest();
client.open("GET", sjsPath + "?state=" + stateQuery, false);
let appcachechannel = SpecialPowers.wrap(client).channel.QueryInterface(Ci.nsIApplicationCacheChannel);

return new Promise((resolve, reject) => {
client.addEventListener("load", resolve);
client.addEventListener("error", reject);

appcachechannel.chooseApplicationCache = false;
appcachechannel.inheritApplicationCache = false;
appcachechannel.applicationCache = null;

client.send();
});
}

add_task(async function() {
/* This test loads "evil" content and verified it isn't loaded when appcache is disabled, which emulates loading stale cache from an untrusted network:
- Sets frame to load "evil" content
- Loads HTML file which also loads and caches content into AppCache
- Sets frame to load "good"
- Check we still have "evil" content from AppCache
- Disables appcache
- Check content is "good"
*/
await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, true]
]
});
await setSJSState(PATH + "file_testFile.sjs", "evil");
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
let windowPromise = new Promise((resolve, reject) => {
function init() {
if (content.document.readyState == "complete") {
const frame = content.document.getElementById("childframe");
const state = frame.contentDocument.getElementById("state");
is(state.textContent, "evil", "Loaded evil content");
resolve();
}
}
content.document.onreadystatechange = init;
init();
});
let appcachePromise = new Promise((resolve, reject) => {
function appcacheInit() {
if (content.applicationCache.status === content.applicationCache.IDLE) {
ok(true, "Application cache loaded");
resolve();
} else {
info("State was: " + content.applicationCache.status);
}
}
content.applicationCache.oncached = appcacheInit;
content.applicationCache.onnoupdate = appcacheInit;
content.applicationCache.onerror = () => {
ok(false, "Application cache failed");
reject();
};
appcacheInit();
});
await Promise.all([windowPromise, appcachePromise]);
});
gBrowser.removeCurrentTab();

// Turn network and proxy off so we can check the content loads still
await setSJSState(PATH + "file_testFile.sjs", "good");
Services.cache2.clear();

// Check we still have the "evil" content despite the state change
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
const frame = content.document.getElementById("childframe");
const state = frame.contentDocument.getElementById("state");
is(state.textContent, "evil", "Loaded evil content from cache");
});
gBrowser.removeCurrentTab();


await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, false]
]
});
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);

// Check that the "good" content is back now appcache is disabled
await ContentTask.spawn(gBrowser.selectedBrowser, [URL], async (URL) => {
const frame = content.document.getElementById("childframe");
const state = frame.contentDocument.getElementById("state");
is(state.textContent, "good", "Loaded good content");
// Eval is needed to execure in child context.
content.window.eval("OfflineTest.clear()");
});

gBrowser.removeCurrentTab();
await setSJSState(PATH + "file_testFile.sjs", "");
await SpecialPowers.popPrefEnv();
});

add_task(async function test_pref_removes_api() {
await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, true]
]
});
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
// Have to use in page checking as IsSecureContextOrObjectIsFromSecureContext is true for spawn()
is(content.document.getElementById("hasAppcache").textContent, "yes", "Appcache is enabled");
is(content.document.getElementById("hasOfflineResourceList").textContent, "yes", "OfflineResourceList is enabled");
});
gBrowser.removeCurrentTab();

await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, false]
]
});
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, [URL], async (URL) => {
is(content.document.getElementById("hasAppcache").textContent, "no", "Appcache is disabled");
is(content.document.getElementById("hasOfflineResourceList").textContent, "no", "OfflineResourceList is disabled");
content.window.eval("OfflineTest.clear()");
});
gBrowser.removeCurrentTab();
});
2 changes: 0 additions & 2 deletions dom/tests/mochitest/general/test_interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,6 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "SVGViewElement", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "SVGZoomAndPan", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Text", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextDecoder", insecureContext: true },
Expand Down
2 changes: 1 addition & 1 deletion dom/webidl/SVGSVGElement.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ interface SVGSVGElement : SVGGraphicsElement {
};

SVGSVGElement includes SVGFitToViewBox;
SVGSVGElement includes SVGZoomAndPanValues;
SVGSVGElement includes SVGZoomAndPan;

2 changes: 1 addition & 1 deletion dom/webidl/SVGViewElement.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ interface SVGViewElement : SVGElement {
};

SVGViewElement includes SVGFitToViewBox;
SVGViewElement includes SVGZoomAndPanValues;
SVGViewElement includes SVGZoomAndPan;

12 changes: 8 additions & 4 deletions dom/webidl/SVGZoomAndPan.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
* liability, trademark and document use rules apply.
*/

[Exposed=Window]
interface SVGZoomAndPan {
};
interface mixin SVGZoomAndPan {
// Zoom and Pan Types
const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0;
const unsigned short SVG_ZOOMANDPAN_DISABLE = 1;
const unsigned short SVG_ZOOMANDPAN_MAGNIFY = 2;

SVGZoomAndPan includes SVGZoomAndPanValues;
[SetterThrows]
attribute unsigned short zoomAndPan;
};
23 changes: 0 additions & 23 deletions dom/webidl/SVGZoomAndPanValues.webidl

This file was deleted.

1 change: 0 additions & 1 deletion dom/webidl/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ WEBIDL_FILES = [
'SVGUseElement.webidl',
'SVGViewElement.webidl',
'SVGZoomAndPan.webidl',
'SVGZoomAndPanValues.webidl',
'TCPServerSocket.webidl',
'TCPServerSocketEvent.webidl',
'TCPSocket.webidl',
Expand Down
Loading

0 comments on commit 678c78a

Please sign in to comment.