Merge mozilla-inbound to mozilla-central. a=merge

This commit is contained in:
Cosmin Sabou 2019-01-22 05:56:10 +02:00
Родитель cfd37ea8ea 322fd9defc
Коммит 951d31e64d
118 изменённых файлов: 1165 добавлений и 241 удалений

Просмотреть файл

@ -1,19 +1,19 @@
# Bug 1204606 - Reformat of dom/media r=jya
# Bug 1204606 - Reformat of dom/media
# https://hg.mozilla.org/mozilla-central/rev/0ceae9db9ec0be18daa1a279511ad305723185d4
abd6d77c618998827e5ffc3dab12f1a34d6ed03d # cinnabar
804b8b8883ba2a6795b0fcf65ebcb18306b6416b # gecko-dev
# Bug 1511181 - Reformat everything to the Google coding style r=ehsan
# Bug 1511181 - Reformat everything to the Google coding style
# https://hg.mozilla.org/mozilla-central/rev/6f3709b3878117466168c40affa7bca0b60cf75b
0e0308d10a5fd4a8dcf0601978776342a2abf2df # cinnabar
265e6721798a455604328ed5262f430cfcc37c2f # gecko-dev
# Bug 1516555 - Reformat everything to the Google coding style r=Ehsan
# Bug 1516555 - Reformat everything to the Google coding style
# https://hg.mozilla.org/mozilla-central/rev/d57dde190f67
cf6442a0664caf8eb39eb75b77963f648597cbd8 # cinnabar
cccdda3c2aec019cc138d410fc0e4aa3e307b6ab # gecko-dev
# Bug 1512961 - Reformat recent changes to the Google coding style r=Ehsan
# Bug 1512961 - Reformat recent changes to the Google coding style
# https://hg.mozilla.org/integration/autoland/rev/8869368a3f30
20061c7bfce850ba0158c7b8a439ac3ecc62a262 # cinnabar
ad75e912fbc1d64ed63c1d0a51d7157566de1887 # gecko-dev
@ -23,6 +23,20 @@ ad75e912fbc1d64ed63c1d0a51d7157566de1887 # gecko-dev
13452f36fb36ad09d81f6b53eaf7928ee63f05e3 # cinnabar
6f45c666bc7f98c3e3250a7c2cf8dc3fb95d12d7 # gecko-dev
# Bug 1519636 - Reformat everything to the Google coding style
# https://hg.mozilla.org/mozilla-central/rev/d54846d01280026138135bde6e0bb1bcfe58feae
abc28896717209d5f0ed2a6b0a46f8e03880ad19 # cinnabar
47a5dd1fb80fa5bbe608c32db426f1ed29b7fd79 # gecko-dev
# Bug 1521000 - Part 1: Reformat the tree to ensure everything is forma…
# https://hg.mozilla.org/mozilla-central/rev/9916e7d6e327
4205caa5c71ba3b111ac494d32d46ff76882b795 # cinnabar
06c3d29113e60ab1a316fbd5a16c667202d012fb # gecko-dev
# Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces…
# https://hg.mozilla.org/mozilla-central/rev/5f4630838d46
d25e4032d4d15e732a78082505d62b6d6ffa1445 # cinnabar
e5e885ae3128a6878d08df4ff6baaf3fc4a4b9e8 # gecko-dev
# Bug 1513205 - Ride along, update some code to match the Google coding style
# https://hg.mozilla.org/integration/autoland/rev/039a7c0c18fb
1ce955dcb2e09fd9ce19c1ec6c470f75db486bd2 # cinnabar

Просмотреть файл

@ -308,6 +308,13 @@ DocManager::OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
return NS_OK;
}
NS_IMETHODIMP
DocManager::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aEvent) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIDOMEventListener

Просмотреть файл

@ -812,7 +812,7 @@ var ContentBlocking = {
Services.telemetry.getHistogramById("TRACKING_PROTECTION_SHIELD").add(value);
},
onSecurityChange(state, webProgress, isSimulated) {
onContentBlockingEvent(event, webProgress, isSimulated) {
let baseURI = this._baseURIForChannelClassifier;
// Don't deal with about:, file: etc.
@ -831,9 +831,9 @@ var ContentBlocking = {
// reporting it using the "report breakage" dialog. Under normal circumstances this
// dialog should only be able to open in the currently selected tab and onSecurityChange
// runs on tab switch, so we can avoid associating the data with the document directly.
blocker.activated = blocker.isBlocking(state);
blocker.activated = blocker.isBlocking(event);
blocker.categoryItem.classList.toggle("blocked", blocker.enabled);
let detected = blocker.isDetected(state);
let detected = blocker.isDetected(event);
blocker.categoryItem.hidden = !detected;
anyDetected = anyDetected || detected;
anyBlocking = anyBlocking || blocker.activated;

Просмотреть файл

@ -4898,13 +4898,40 @@ var XULBrowserWindow = {
// Properties used to cache security state used to update the UI
_state: null,
_lastLocation: null,
_event: null,
_lastLocationForEvent: null,
// This is called in multiple ways:
// 1. Due to the nsIWebProgressListener.onContentBlockingEvent notification.
// 2. Called by tabbrowser.xml when updating the current browser.
// 3. Called directly during this object's initializations.
// 4. Due to the nsIWebProgressListener.onLocationChange notification.
// aRequest will be null always in case 2 and 3, and sometimes in case 1 (for
// instance, there won't be a request when STATE_BLOCKED_TRACKING_CONTENT is observed).
onContentBlockingEvent(aWebProgress, aRequest, aEvent, aIsSimulated) {
// Don't need to do anything if the data we use to update the UI hasn't
// changed
let uri = gBrowser.currentURI;
let spec = uri.spec;
if (this._event == aEvent &&
this._lastLocationForEvent == spec) {
return;
}
this._event = aEvent;
this._lastLocationForEvent = spec;
if (typeof(aIsSimulated) != "boolean" && typeof(aIsSimulated) != "undefined") {
throw "onContentBlockingEvent: aIsSimulated receieved an unexpected type";
}
ContentBlocking.onContentBlockingEvent(this._event, aWebProgress, aIsSimulated);
},
// This is called in multiple ways:
// 1. Due to the nsIWebProgressListener.onSecurityChange notification.
// 2. Called by tabbrowser.xml when updating the current browser.
// 3. Called directly during this object's initializations.
// aRequest will be null always in case 2 and 3, and sometimes in case 1 (for
// instance, there won't be a request when STATE_BLOCKED_TRACKING_CONTENT is observed).
// aRequest will be null always in case 2 and 3, and sometimes in case 1.
onSecurityChange(aWebProgress, aRequest, aState, aIsSimulated) {
// Don't need to do anything if the data we use to update the UI hasn't
// changed
@ -4920,10 +4947,6 @@ var XULBrowserWindow = {
this._state = aState;
this._lastLocation = spec;
if (typeof(aIsSimulated) != "boolean" && typeof(aIsSimulated) != "undefined") {
throw "onSecurityChange: aIsSimulated receieved an unexpected type";
}
// Make sure the "https" part of the URL is striked out or not,
// depending on the current mixed active content blocking state.
gURLBar.formatValue();
@ -4932,7 +4955,6 @@ var XULBrowserWindow = {
uri = Services.uriFixup.createExposableURI(uri);
} catch (e) {}
gIdentityHandler.updateIdentity(this._state, uri);
ContentBlocking.onSecurityChange(this._state, aWebProgress, aIsSimulated);
},
// simulate all change notifications after switching tabs

Просмотреть файл

@ -968,10 +968,13 @@ window._gBrowser = {
let securityUI = newBrowser.securityUI;
if (securityUI) {
this._callProgressListeners(null, "onSecurityChange",
[webProgress, null, securityUI.state],
true, false);
// Include the true final argument to indicate that this event is
// simulated (instead of being observed by the webProgressListener).
this._callProgressListeners(null, "onSecurityChange",
[webProgress, null, securityUI.state, true],
this._callProgressListeners(null, "onContentBlockingEvent",
[webProgress, null, securityUI.contentBlockingEvent, true],
true, false);
}
@ -1718,10 +1721,14 @@ window._gBrowser = {
let securityUI = aBrowser.securityUI;
let state = securityUI ? securityUI.state :
Ci.nsIWebProgressListener.STATE_IS_INSECURE;
this._callProgressListeners(aBrowser, "onSecurityChange",
[aBrowser.webProgress, null, state],
true, false);
let event = securityUI ? securityUI.contentBlockingEvent : 0;
// Include the true final argument to indicate that this event is
// simulated (instead of being observed by the webProgressListener).
this._callProgressListeners(aBrowser, "onSecurityChange",
[aBrowser.webProgress, null, state, true],
this._callProgressListeners(aBrowser, "onContentBlockingEvent",
[aBrowser.webProgress, null, event, true],
true, false);
if (aShouldBeRemote) {
@ -5192,6 +5199,10 @@ class TabProgressListener {
if (!this.mBlank) {
this._callProgressListeners("onLocationChange",
[aWebProgress, aRequest, aLocation, aFlags]);
// Include the true final argument to indicate that this event is
// simulated (instead of being observed by the webProgressListener).
this._callProgressListeners("onContentBlockingEvent",
[aWebProgress, null, 0, true]);
}
if (topLevel) {
@ -5215,6 +5226,11 @@ class TabProgressListener {
[aWebProgress, aRequest, aState]);
}
onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
this._callProgressListeners("onContentBlockingEvent",
[aWebProgress, aRequest, aEvent]);
}
onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) {
return this._callProgressListeners("onRefreshAttempted",
[aWebProgress, aURI, aDelay, aSameURI]);

Просмотреть файл

@ -69,19 +69,21 @@ async function testTrackingProtectionAnimation(tabbrowser) {
ok(!ContentBlocking.iconBox.hasAttribute("animate"), "iconBox not animating");
info("Reload tracking cookies tab");
securityChanged = waitForSecurityChange(2, tabbrowser.ownerGlobal);
securityChanged = waitForSecurityChange(1, tabbrowser.ownerGlobal);
let contentBlockingEvent = waitForContentBlockingEvent(2, tabbrowser.ownerGlobal);
tabbrowser.reload();
await securityChanged;
await Promise.all([securityChanged, contentBlockingEvent]);
ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
ok(ContentBlocking.iconBox.hasAttribute("animate"), "iconBox animating");
await BrowserTestUtils.waitForEvent(ContentBlocking.animatedIcon, "animationend");
info("Reload tracking tab");
securityChanged = waitForSecurityChange(3, tabbrowser.ownerGlobal);
securityChanged = waitForSecurityChange(2, tabbrowser.ownerGlobal);
contentBlockingEvent = waitForContentBlockingEvent(3, tabbrowser.ownerGlobal);
tabbrowser.selectedTab = trackingTab;
tabbrowser.reload();
await securityChanged;
await Promise.all([securityChanged, contentBlockingEvent]);
ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
ok(ContentBlocking.iconBox.hasAttribute("animate"), "iconBox animating");

Просмотреть файл

@ -6,13 +6,13 @@ add_task(async function test_fetch() {
]});
await BrowserTestUtils.withNewTab({ gBrowser, url: URL }, async function(newTabBrowser) {
let securityChange = waitForSecurityChange();
let contentBlockingEvent = waitForContentBlockingEvent();
await ContentTask.spawn(newTabBrowser, null, async function() {
await content.wrappedJSObject.test_fetch()
.then(response => Assert.ok(false, "should have denied the request"))
.catch(e => Assert.ok(true, `Caught exception: ${e}`));
});
await securityChange;
await contentBlockingEvent;
let ContentBlocking = newTabBrowser.ownerGlobal.ContentBlocking;
ok(ContentBlocking, "got CB object");

Просмотреть файл

@ -54,7 +54,7 @@ add_task(async function testShieldHistogram() {
await promiseTabLoadEvent(tab, TRACKING_PAGE);
// Note that right now the shield histogram is not measuring what
// you might think. Since onSecurityChange fires twice for a tracking page,
// you might think. Since onContentBlockingEvent fires twice for a tracking page,
// the total page loads count is double counting, and the shield count
// (which is meant to measure times when the shield wasn't shown) fires even
// when tracking elements exist on the page.

Просмотреть файл

@ -59,3 +59,23 @@ function waitForSecurityChange(numChanges = 1, win = null) {
win.gBrowser.addProgressListener(listener);
});
}
function waitForContentBlockingEvent(numChanges = 1, win = null) {
if (!win) {
win = window;
}
return new Promise(resolve => {
let n = 0;
let listener = {
onContentBlockingEvent() {
n = n + 1;
info("Received onContentBlockingEvent event " + n + " of " + numChanges);
if (n >= numChanges) {
win.gBrowser.removeProgressListener(listener);
resolve(n);
}
},
};
win.gBrowser.addProgressListener(listener);
});
}

Просмотреть файл

@ -24,3 +24,47 @@ add_task(async function test_update_preferences_ui() {
BrowserTestUtils.removeTab(tab);
});
add_task(async function test_update_about_ui() {
let aboutDialog = await waitForAboutDialog();
let panelId = "policyDisabled";
await BrowserTestUtils.waitForCondition(() =>
(aboutDialog.document.getElementById("updateDeck").selectedPanel &&
aboutDialog.document.getElementById("updateDeck").selectedPanel.id == panelId),
"Waiting for expected panel ID - expected \"" + panelId + "\"");
is(aboutDialog.document.getElementById("updateDeck").selectedPanel.id, panelId,
"The About Dialog panel Id should equal " + panelId);
aboutDialog.close();
});
/**
* Waits for the About Dialog to load.
*
* @return A promise that returns the domWindow for the About Dialog and
* resolves when the About Dialog loads.
*/
function waitForAboutDialog() {
return new Promise(resolve => {
var listener = {
onOpenWindow: aXULWindow => {
Services.wm.removeListener(listener);
async function aboutDialogOnLoad() {
domwindow.removeEventListener("load", aboutDialogOnLoad, true);
let chromeURI = "chrome://browser/content/aboutDialog.xul";
is(domwindow.document.location.href, chromeURI, "About dialog appeared");
resolve(domwindow);
}
var domwindow = aXULWindow.docShell.domWindow;
domwindow.addEventListener("load", aboutDialogOnLoad, true);
},
onCloseWindow: aXULWindow => {},
};
Services.wm.addListener(listener);
openAboutDialog();
});
}

Просмотреть файл

@ -1244,6 +1244,7 @@ this.tabs = class extends ExtensionAPI {
onLocationChange(webProgress, request, location, flags) { },
onProgressChange(webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) { },
onSecurityChange(webProgress, request, state) { },
onContentBlockingEvent(webProgress, request, event) { },
onStateChange(webProgress, request, flags, status) {
if ((flags & Ci.nsIWebProgressListener.STATE_STOP) && (flags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT)) {
resolve(retval == 0 ? "saved" : "replaced");

Просмотреть файл

@ -14,6 +14,7 @@ support-files =
file_firstPartyBasic.html
file_postMessage.html
file_postMessageSender.html
file_saveAs.sjs
file_sharedworker.html
file_sharedworker.js
file_thirdPartyChild.audio.ogg
@ -59,6 +60,7 @@ support-files =
window_redirect.html
worker_blobify.js
worker_deblobify.js
!/toolkit/content/tests/browser/common/mockTransfer.js
[browser_broadcastChannel.js]
[browser_cache.js]
@ -72,6 +74,7 @@ skip-if = debug #Bug 1345346
[browser_firstPartyIsolation_aboutPages.js]
[browser_firstPartyIsolation_blobURI.js]
[browser_firstPartyIsolation_js_uri.js]
[browser_firstPartyIsolation_saveAs.js]
[browser_localStorageIsolation.js]
[browser_blobURLIsolation.js]
skip-if = (verify && debug && (os == 'win'))

Просмотреть файл

@ -0,0 +1,266 @@
/**
* Bug 1508355 - A test case for ensuring the saving channel has a correct first
* party domain when going through different "Save ... AS."
*/
"use strict";
/* import-globals-from ../../../../../toolkit/content/tests/browser/common/mockTransfer.js */
Services.scriptloader
.loadSubScript("chrome://mochitests/content/browser/toolkit/content/tests/browser/common/mockTransfer.js",
this);
const TEST_FIRST_PARTY = "example.com";
const TEST_ORIGIN = `http://${TEST_FIRST_PARTY}`;
const TEST_BASE_PATH = "/browser/browser/components/originattributes/test/browser/";
const TEST_PATH = `${TEST_BASE_PATH}file_saveAs.sjs`;
const TEST_PATH_VIDEO = `${TEST_BASE_PATH}file_thirdPartyChild.video.ogv`;
const TEST_PATH_IMAGE = `${TEST_BASE_PATH}file_favicon.png`;
// For the "Save Page As" test, we will check the channel of the sub-resource
// within the page. In this case, it is a image.
const TEST_PATH_PAGE = `${TEST_BASE_PATH}file_favicon.png`;
// For the "Save Frame As" test, we will check the channel of the sub-resource
// within the frame. In this case, it is a image.
const TEST_PATH_FRAME = `${TEST_BASE_PATH}file_favicon.png`;
let MockFilePicker = SpecialPowers.MockFilePicker;
MockFilePicker.init(window);
add_task(async function setup() {
info("Setting the prefs.");
await SpecialPowers.pushPrefEnv({"set": [
["privacy.firstparty.isolate", true],
]});
info("Setting MockFilePicker.");
let tempDir = createTemporarySaveDirectory();
MockFilePicker.displayDirectory = tempDir;
MockFilePicker.showCallback = fp => {
info("MockFilePicker showCallback");
let fileName = fp.defaultString;
let destFile = tempDir.clone();
destFile.append(fileName);
MockFilePicker.setFiles([destFile]);
MockFilePicker.filterIndex = 0; // kSaveAsType_Complete
info("MockFilePicker showCallback done");
};
mockTransferRegisterer.register();
registerCleanupFunction(function() {
mockTransferRegisterer.unregister();
MockFilePicker.cleanup();
tempDir.remove(true);
});
});
function createTemporarySaveDirectory() {
let saveDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
saveDir.append("testsavedir");
saveDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
return saveDir;
}
function createPromiseForObservingChannel(aURL, aFirstParty) {
return new Promise(resolve => {
let observer = (aSubject, aTopic) => {
if (aTopic === "http-on-modify-request") {
let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
let reqLoadInfo = httpChannel.loadInfo;
// Make sure this is the request which we want to check.
if (!httpChannel.URI.spec.endsWith(aURL)) {
return;
}
info(`Checking loadInfo for URI: ${httpChannel.URI.spec}\n`);
is(reqLoadInfo.originAttributes.firstPartyDomain, aFirstParty,
"The loadInfo has correct first party domain");
Services.obs.removeObserver(observer, "http-on-modify-request");
resolve();
}
};
Services.obs.addObserver(observer, "http-on-modify-request");
});
}
function createPromiseForTransferComplete() {
return new Promise((resolve) => {
function onTransferComplete(downloadSuccess) {
ok(downloadSuccess, "File should have been downloaded successfully");
// Clear the callback for now.
mockTransferCallback = () => { };
resolve();
}
mockTransferCallback = onTransferComplete;
});
}
async function doCommandForFrameType() {
info("Opening the frame sub-menu under the context menu.");
let contextMenu = document.getElementById("contentAreaContextMenu");
let frameMenuPopup = contextMenu.querySelector("#frame").menupopup;
let frameMenuPopupPromise = BrowserTestUtils.waitForEvent(frameMenuPopup,
"popupshown");
frameMenuPopup.openPopup();
await frameMenuPopupPromise;
info("Triggering the save process.");
let saveFrameCommand = contextMenu.querySelector("#context-saveframe");
saveFrameCommand.doCommand();
}
add_task(async function testContextMenuSaveAs() {
const TEST_DATA = [
{ type: "link", path: TEST_PATH, target: "#link1" },
{ type: "video", path: TEST_PATH_VIDEO, target: "#video1" },
{ type: "image", path: TEST_PATH_IMAGE, target: "#image1" },
{ type: "page", path: TEST_PATH_PAGE, target: "body" },
{ type: "frame", path: TEST_PATH_FRAME, target: "#frame1",
doCommandFunc: doCommandForFrameType },
];
for (const data of TEST_DATA) {
info(`Open a new tab for testing "Save ${data.type} as" in context menu.`);
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
`${TEST_ORIGIN}${TEST_PATH}?${data.type}=1`);
let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown");
info("Open the context menu.");
await BrowserTestUtils.synthesizeMouseAtCenter(data.target, {
type: "contextmenu",
button: 2,
},
gBrowser.selectedBrowser);
await popupShownPromise;
let transferCompletePromise = createPromiseForTransferComplete();
let observerPromise = createPromiseForObservingChannel(data.path, TEST_FIRST_PARTY);
// Select "Save As" option from context menu.
if (!data.doCommandFunc) {
let saveElement = document.getElementById(`context-save${data.type}`);
info("Triggering the save process.");
saveElement.doCommand();
} else {
await data.doCommandFunc();
}
info("Waiting for the channel.");
await observerPromise;
info("Close the context menu.");
let contextMenu = document.getElementById("contentAreaContextMenu");
let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
contextMenu.hidePopup();
await popupHiddenPromise;
info("Wait until the save is finished.");
await transferCompletePromise;
BrowserTestUtils.removeTab(tab);
}
});
add_task(async function testFileMenuSavePageAs() {
info(`Open a new tab for testing "Save Page AS" in the file menu.`);
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
`${TEST_ORIGIN}${TEST_PATH}?page=1`);
let transferCompletePromise = createPromiseForTransferComplete();
let observerPromise = createPromiseForObservingChannel(TEST_PATH_PAGE, TEST_FIRST_PARTY);
let menubar = document.getElementById("main-menubar");
let filePopup = document.getElementById("menu_FilePopup");
// We only use the shortcut keys to open the file menu in Windows and Linux.
// Mac doesn't have a shortcut to only open the file menu. Instead, we directly
// trigger the save in MAC without any UI interactions.
if (Services.appinfo.OS !== "Darwin") {
let menubarActive = BrowserTestUtils.waitForEvent(menubar, "DOMMenuBarActive");
EventUtils.synthesizeKey("KEY_F10");
await menubarActive;
let popupShownPromise = BrowserTestUtils.waitForEvent(filePopup, "popupshown");
// In window, it still needs one extra down key to open the file menu.
if (Services.appinfo.OS === "WINNT") {
EventUtils.synthesizeKey("KEY_ArrowDown");
}
await popupShownPromise;
}
info("Triggering the save process.");
let fileSavePageAsElement = document.getElementById("menu_savePage");
fileSavePageAsElement.doCommand();
info("Waiting for the channel.");
await observerPromise;
// Close the file menu.
if (Services.appinfo.OS !== "Darwin") {
let popupHiddenPromise = BrowserTestUtils.waitForEvent(filePopup, "popuphidden");
filePopup.hidePopup();
await popupHiddenPromise;
}
info("Wait until the save is finished.");
await transferCompletePromise;
BrowserTestUtils.removeTab(tab);
});
add_task(async function testPageInfoMediaSaveAs() {
info(`Open a new tab for testing "Save AS" in the media panel of the page info.`);
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
`${TEST_ORIGIN}${TEST_PATH}?pageinfo=1`);
info("Open the media panel of the pageinfo.");
let pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
"mediaTab");
await BrowserTestUtils.waitForEvent(pageInfo, "load");
await new Promise(resolve => pageInfo.onFinished.push(() => executeSoon(resolve)));
let imageTree = pageInfo.document.getElementById("imagetree");
let imageRowsNum = imageTree.view.rowCount;
is(imageRowsNum, 2, "There should be two media items here.");
for (let i = 0; i < imageRowsNum; i++) {
imageTree.view.selection.select(i);
imageTree.ensureRowIsVisible(i);
imageTree.focus();
let url = pageInfo.gImageView.data[i][0]; // COL_IMAGE_ADDRESS
info(`Start to save the media item with URL: ${url}`);
let transferCompletePromise = createPromiseForTransferComplete();
let observerPromise = createPromiseForObservingChannel(url, TEST_FIRST_PARTY);
info("Triggering the save process.");
let saveElement = pageInfo.document.getElementById("imagesaveasbutton");
saveElement.doCommand();
info("Waiting for the channel.");
await observerPromise;
info("Wait until the save is finished.");
await transferCompletePromise;
}
pageInfo.close();
BrowserTestUtils.removeTab(tab);
});

Просмотреть файл

@ -0,0 +1,40 @@
const HTTP_ORIGIN = "http://example.com";
const SECOND_ORIGIN = "http://example.org";
const URI_PATH = "/browser/browser/components/originattributes/test/browser/";
const LINK_PATH = `${URI_PATH}file_saveAs.sjs`;
// Reusing existing ogv file for testing.
const VIDEO_PATH = `${URI_PATH}file_thirdPartyChild.video.ogv`;
// Reusing existing png file for testing.
const IMAGE_PATH = `${URI_PATH}file_favicon.png`;
const FRAME_PATH = `${SECOND_ORIGIN}${URI_PATH}file_saveAs.sjs?image=1`
Components.utils.importGlobalProperties(["URLSearchParams"]);
function handleRequest(aRequest, aResponse) {
var params = new URLSearchParams(aRequest.queryString);
aResponse.setStatusLine(aRequest.httpVersion, 200);
aResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
let contentBody = "";
if (params.has("link")) {
contentBody = `<a href="${LINK_PATH}" id="link1">this is a link</a>`;
} else if (params.has("video")) {
contentBody = `<video src="${VIDEO_PATH}" id="video1"> </video>`;
} else if (params.has("image")) {
contentBody = `<img src="${IMAGE_PATH}" id="image1">`;
} else if (params.has("page")) {
// We need at least one resource, like a img, a link or a script, to trigger
// downloading resources in "Save Page As". Otherwise, it will output the
// document directly without any network request.
contentBody = `<img src="${IMAGE_PATH}">`;
} else if (params.has("frame")) {
// Like "Save Page As", we need to put at least one resource in the frame.
// Here we also use a image.
contentBody = `<iframe src="${FRAME_PATH}" id="frame1"></iframe>`;
} else if (params.has("pageinfo")) {
contentBody = `<img src="${IMAGE_PATH}" id="image1">
<video src="${VIDEO_PATH}" id="video1"> </video>`;
}
aResponse.write(`<html><body>${contentBody}</body></html>`);
}

Просмотреть файл

@ -188,6 +188,13 @@ nsMacShellService::OnSecurityChange(nsIWebProgress* aWebProgress,
return NS_OK;
}
NS_IMETHODIMP
nsMacShellService::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
uint32_t aEvent) {
return NS_OK;
}
NS_IMETHODIMP
nsMacShellService::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aStateFlags,

Просмотреть файл

@ -863,6 +863,7 @@ StorageAccessPermissionPrompt.prototype = {
displayURI: false,
name: this.prettifyHostPort(this.principal.URI),
secondName: this.prettifyHostPort(this.topLevelPrincipal.URI),
escAction: "buttoncommand",
};
},

Просмотреть файл

@ -24,6 +24,7 @@ function browserLocationChanged(browser) {
onStateChange() {},
onSecurityChange() {},
onStatusChange() {},
onContentBlockingEvent() {},
onLocationChange(aWebProgress, aRequest, aURI, aFlags) {
if (!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE)) {
browser.webProgress.removeProgressListener(filter);

Просмотреть файл

@ -8,6 +8,7 @@ const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { getStr } = require("../utils/l10n");
const Types = require("../types");
class Declaration extends PureComponent {
@ -45,9 +46,7 @@ class Declaration extends PureComponent {
}
renderComputedPropertyList() {
const { computedProperties } = this.props.declaration;
if (!computedProperties.length) {
if (!this.state.isComputedListExpanded) {
return null;
}
@ -56,10 +55,10 @@ class Declaration extends PureComponent {
{
className: "ruleview-computedlist",
style: {
display: this.state.isComputedListExpanded ? "block" : "",
display: "block",
},
},
computedProperties.map(({ name, value, isOverridden }) => {
this.props.declaration.computedProperties.map(({ name, value, isOverridden }) => {
return (
dom.li(
{
@ -83,19 +82,20 @@ class Declaration extends PureComponent {
}
renderShorthandOverriddenList() {
const { declaration } = this.props;
if (this.state.isComputedListExpanded || this.props.declaration.isOverridden) {
return null;
}
if (this.state.isComputedListExpanded || declaration.isOverridden) {
const overriddenComputedProperties = this.props.declaration.computedProperties
.filter(prop => prop.isOverridden);
if (!overriddenComputedProperties.length) {
return null;
}
return (
dom.ul({ className: "ruleview-overridden-items" },
declaration.computedProperties.map(({ name, value, isOverridden }) => {
if (!isOverridden) {
return null;
}
overriddenComputedProperties.map(({ name, value }) => {
return (
dom.li(
{
@ -118,15 +118,16 @@ class Declaration extends PureComponent {
}
render() {
const { declaration } = this.props;
const {
computedProperties,
isDeclarationValid,
isEnabled,
isKnownProperty,
isNameValid,
isOverridden,
name,
value,
} = declaration;
} = this.props.declaration;
return (
dom.li(
@ -155,7 +156,18 @@ class Declaration extends PureComponent {
dom.span({ className: "ruleview-propertyvaluecontainer" },
dom.span({ className: "ruleview-propertyvalue theme-fg-color1" }, value),
";"
)
),
dom.div({
className: "ruleview-warning" +
(isDeclarationValid ? " hidden" : ""),
title: isNameValid ?
getStr("rule.warningName.title") : getStr("rule.warning.title"),
}),
dom.div({
className: "ruleview-overridden-rule-filter" +
(!isDeclarationValid || !isOverridden ? " hidden" : ""),
title: getStr("rule.filterProperty.title"),
})
),
this.renderComputedPropertyList(),
this.renderShorthandOverriddenList()

Просмотреть файл

@ -32,6 +32,8 @@ class Rule extends PureComponent {
} = this.props;
const {
declarations,
isUnmatched,
isUserAgentStyle,
selector,
sourceLink,
type,
@ -39,7 +41,11 @@ class Rule extends PureComponent {
return (
dom.div(
{ className: "ruleview-rule devtools-monospace" },
{
className: "ruleview-rule devtools-monospace" +
(isUnmatched ? " unmatched" : "") +
(isUserAgentStyle ? " uneditable" : ""),
},
SourceLink({ sourceLink }),
dom.div({ className: "ruleview-code" },
dom.div({},

Просмотреть файл

@ -32,10 +32,15 @@ function getDeclarationState(declaration, ruleId) {
computedProperties: declaration.computedProperties,
// An unique CSS declaration id.
id: declaration.id,
// Whether or not the declaration is valid. (Does it make sense for this value
// to be assigned to this property name?)
isDeclarationValid: declaration.isValid(),
// Whether or not the declaration is enabled.
isEnabled: declaration.enabled,
// Whether or not the declaration's property name is known.
isKnownProperty: declaration.isKnownProperty,
// Whether or not the property name is valid.
isNameValid: declaration.isNameValid(),
// Whether or not the the declaration is overridden.
isOverridden: !!declaration.overridden,
// The declaration's property name.

Просмотреть файл

@ -25,12 +25,19 @@ const declaration = exports.declaration = {
// An unique CSS declaration id.
id: PropTypes.string,
// Whether or not the declaration is valid. (Does it make sense for this value
// to be assigned to this property name?)
isDeclarationValid: PropTypes.bool,
// Whether or not the declaration is enabled.
isEnabled: PropTypes.bool,
// Whether or not the declaration's property name is known.
isKnownProperty: PropTypes.bool,
// Whether or not the property name is valid.
isNameValid: PropTypes.bool,
// Whether or not the the declaration is overridden.
isOverridden: PropTypes.bool,

Просмотреть файл

@ -422,6 +422,7 @@ MessageManagerTunnel.prototype = {
"Content:SecurityChange",
"Content:StateChange",
"Content:StatusChange",
"Content:ContentBlockingEvent",
// Messages sent to browser.js
"DOMTitleChanged",
"ImageDocumentLoaded",

Просмотреть файл

@ -172,7 +172,9 @@
.ruleview-computedlist,
.ruleview-expandable-container[hidden],
.ruleview-overridden-items[hidden],
.ruleview-overridden-rule-filter.hidden,
.ruleview-overridden-rule-filter[hidden],
.ruleview-warning.hidden,
.ruleview-warning[hidden],
.ruleview-overridden .ruleview-grid {
display: none;
@ -257,31 +259,41 @@
* Display rules that don't match the current selected element and uneditable
* user agent styles differently
*/
.ruleview-rule.unmatched,
.ruleview-rule.uneditable,
.ruleview-rule[unmatched=true],
.ruleview-rule[uneditable=true] {
background: var(--theme-tab-toolbar-background);
}
.ruleview-rule.unmatched,
.ruleview-rule[unmatched=true] {
opacity: 0.5;
}
.ruleview-rule.uneditable :focus,
.ruleview-rule[uneditable=true] :focus {
outline: none;
}
.ruleview-rule.uneditable .theme-link,
.ruleview-rule[uneditable=true] .theme-link {
color: var(--theme-highlight-bluegrey);
}
.ruleview-rule.uneditable .ruleview-enableproperty,
.ruleview-rule[uneditable=true] .ruleview-enableproperty {
visibility: hidden;
}
.ruleview-rule.uneditable .ruleview-swatch,
.ruleview-rule[uneditable=true] .ruleview-swatch {
cursor: default;
}
.ruleview-rule.uneditable .ruleview-namecontainer > .ruleview-propertyname,
.ruleview-rule.uneditable .ruleview-propertyvaluecontainer >
.ruleview-propertyvalue,
.ruleview-rule[uneditable=true] .ruleview-namecontainer > .ruleview-propertyname,
.ruleview-rule[uneditable=true] .ruleview-propertyvaluecontainer >
.ruleview-propertyvalue {

Просмотреть файл

@ -6548,6 +6548,13 @@ nsDocShell::OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aEvent) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}
nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
nsIChannel* aChannel, nsresult aStatus) {
if (!aChannel) {

Просмотреть файл

@ -700,6 +700,13 @@ nsDocShellTreeOwner::OnSecurityChange(nsIWebProgress* aWebProgress,
return NS_OK;
}
NS_IMETHODIMP
nsDocShellTreeOwner::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
uint32_t aEvent) {
return NS_OK;
}
//*****************************************************************************
// nsDocShellTreeOwner: Accessors
//*****************************************************************************

Просмотреть файл

@ -155,6 +155,7 @@ var tabStateListener = {
onLocationChange: () => {},
onSecurityChange: () => {},
onProgressChange: () => {},
onContentBlockingEvent: () => {},
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener])
};

Просмотреть файл

@ -246,6 +246,8 @@ class nsContentSink : public nsICSSLoaderObserver,
static void NotifyDocElementCreated(Document* aDoc);
Document* GetDocument() { return mDocument; }
protected:
void FavorPerformanceHint(bool perfOverStarvation, uint32_t starvationDelay);

Просмотреть файл

@ -5338,7 +5338,7 @@ void nsGlobalWindowOuter::FirePopupBlockedEvent(
aDoc->DispatchEvent(*event);
}
void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState,
void nsGlobalWindowOuter::NotifyContentBlockingEvent(unsigned aEvent,
nsIChannel* aChannel,
bool aBlocked,
nsIURI* aURIHint) {
@ -5356,59 +5356,59 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState,
// check that the loading URI for the channel is the same as the URI currently
// loaded in the document.
if (!SameLoadingURI(doc, aChannel) &&
aState == nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT) {
aEvent == nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT) {
return;
}
// Notify nsIWebProgressListeners of this security event.
// Notify nsIWebProgressListeners of this content blocking event.
// Can be used to change the UI state.
nsresult rv = NS_OK;
nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell, &rv);
NS_ENSURE_SUCCESS_VOID(rv);
uint32_t state = 0;
uint32_t event = 0;
nsCOMPtr<nsISecureBrowserUI> securityUI;
docShell->GetSecurityUI(getter_AddRefs(securityUI));
if (!securityUI) {
return;
}
securityUI->GetState(&state);
securityUI->GetContentBlockingEvent(&event);
nsAutoCString origin;
nsContentUtils::GetASCIIOrigin(aURIHint, origin);
bool blockedValue = aBlocked;
bool unblocked = false;
if (aState == nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT) {
if (aEvent == nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT) {
doc->SetHasTrackingContentBlocked(aBlocked, origin);
if (!aBlocked) {
unblocked = !doc->GetHasTrackingContentBlocked();
}
} else if (aState == nsIWebProgressListener::STATE_LOADED_TRACKING_CONTENT) {
} else if (aEvent == nsIWebProgressListener::STATE_LOADED_TRACKING_CONTENT) {
doc->SetHasTrackingContentLoaded(aBlocked, origin);
if (!aBlocked) {
unblocked = !doc->GetHasTrackingContentLoaded();
}
} else if (aState ==
} else if (aEvent ==
nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION) {
doc->SetHasCookiesBlockedByPermission(aBlocked, origin);
if (!aBlocked) {
unblocked = !doc->GetHasCookiesBlockedByPermission();
}
} else if (aState == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER) {
} else if (aEvent == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER) {
doc->SetHasTrackingCookiesBlocked(aBlocked, origin);
if (!aBlocked) {
unblocked = !doc->GetHasTrackingCookiesBlocked();
}
} else if (aState == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL) {
} else if (aEvent == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL) {
doc->SetHasAllCookiesBlocked(aBlocked, origin);
if (!aBlocked) {
unblocked = !doc->GetHasAllCookiesBlocked();
}
} else if (aState == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN) {
} else if (aEvent == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN) {
doc->SetHasForeignCookiesBlocked(aBlocked, origin);
if (!aBlocked) {
unblocked = !doc->GetHasForeignCookiesBlocked();
}
} else if (aState == nsIWebProgressListener::STATE_COOKIES_LOADED) {
} else if (aEvent == nsIWebProgressListener::STATE_COOKIES_LOADED) {
MOZ_ASSERT(!aBlocked,
"We don't expected to see blocked STATE_COOKIES_LOADED");
// Note that the logic in this branch is the logical negation of the logic
@ -5422,14 +5422,14 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState,
} else {
// Ignore nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT;
}
const uint32_t oldState = state;
const uint32_t oldEvent = event;
if (blockedValue) {
state |= aState;
event |= aEvent;
} else if (unblocked) {
state &= ~aState;
event &= ~aEvent;
}
if (state == oldState
if (event == oldEvent
#ifdef ANDROID
// GeckoView always needs to notify about blocked trackers, since the
// GeckoView API always needs to report the URI and type of any blocked
@ -5437,14 +5437,14 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState,
// We use a platform-dependent code path here because reporting this
// notification on desktop platforms isn't necessary and doing so can have
// a big performance cost.
&& aState != nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT
&& aEvent != nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT
#endif
) {
// Avoid dispatching repeated notifications when nothing has changed
return;
}
eventSink->OnSecurityChange(aChannel, state);
eventSink->OnContentBlockingEvent(aChannel, event);
}
// static

Просмотреть файл

@ -458,7 +458,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
Document* aDoc, nsIURI* aPopupURI, const nsAString& aPopupWindowName,
const nsAString& aPopupWindowFeatures) override;
virtual void NotifyContentBlockingState(unsigned aState, nsIChannel* aChannel,
virtual void NotifyContentBlockingEvent(unsigned aEvent, nsIChannel* aChannel,
bool aBlocked,
nsIURI* aURIHint) override;

Просмотреть файл

@ -1023,7 +1023,7 @@ class nsPIDOMWindowOuter : public mozIDOMWindowProxy {
const nsAString& aPopupWindowName,
const nsAString& aPopupWindowFeatures) = 0;
virtual void NotifyContentBlockingState(unsigned aState, nsIChannel* aChannel,
virtual void NotifyContentBlockingEvent(unsigned aEvent, nsIChannel* aChannel,
bool aBlocked, nsIURI* aURIHint) = 0;
// WebIDL-ish APIs

Просмотреть файл

@ -1201,14 +1201,6 @@ BrowserElementChild.prototype = {
securityStateDesc = '???';
}
var trackingStateDesc;
if (state & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT) {
trackingStateDesc = 'loaded_tracking_content';
}
else if (state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) {
trackingStateDesc = 'blocked_tracking_content';
}
var mixedStateDesc;
if (state & Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
mixedStateDesc = 'blocked_mixed_active_content';
@ -1219,19 +1211,14 @@ BrowserElementChild.prototype = {
}
var isEV = !!(state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL);
var isTrackingContent = !!(state &
(Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT |
Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT));
var isMixedContent = !!(state &
(Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT |
Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT));
sendAsyncMsg('securitychange', {
state: securityStateDesc,
trackingState: trackingStateDesc,
mixedState: mixedStateDesc,
extendedValidation: isEV,
trackingContent: isTrackingContent,
mixedContent: isMixedContent,
});
},

Просмотреть файл

@ -9,9 +9,6 @@ SimpleTest.waitForExplicitFinish();
browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.jsm');
const { UrlClassifierTestUtils } = SpecialPowers.Cu.import('resource://testing-common/UrlClassifierTestUtils.jsm', {});
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', 'true');
@ -30,34 +27,21 @@ function runTest() {
case 1:
is(lastSecurityState.state, 'secure');
is(lastSecurityState.extendedValidation, false);
is(lastSecurityState.trackingContent, false);
is(lastSecurityState.mixedContent, false);
iframe.src = "http://example.com/" + filepath;
break;
case 2:
is(lastSecurityState.state, 'insecure');
is(lastSecurityState.extendedValidation, false);
is(lastSecurityState.trackingContent, false);
is(lastSecurityState.mixedContent, false);
iframe.src = 'https://example.com:443/' + filepath + '?broken';
break;
case 3:
is(lastSecurityState.state, 'broken');
is(lastSecurityState.extendedValidation, false);
is(lastSecurityState.trackingContent, false);
is(lastSecurityState.mixedContent, true);
iframe.src = "http://example.com/" + filepath + '?tracking';
break;
case 4:
is(lastSecurityState.state, 'insecure');
is(lastSecurityState.extendedValidation, false);
// TODO: I'm having trouble getting the tracking protection
// test changes to be enabled in the child process, so this
// isn't currently blocked in tests, but it works when
// manually testing.
// is(lastSecurityState.trackingContent, true);
is(lastSecurityState.mixedContent, false);
SimpleTest.finish();
break;
}
});
@ -66,17 +50,9 @@ function runTest() {
}
addEventListener('testready', function() {
SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
SpecialPowers.pushPrefEnv({"set" : [
["privacy.trackingprotection.enabled", true],
["privacy.trackingprotection.pbmode.enabled", false],
["browser.safebrowsing.phishing.enabled", false],
["browser.safebrowsing.malware.enabled", false],
]}, () => {
SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
UrlClassifierTestUtils.addTestTrackers().then(() => {
runTest();
});
});
]}, runTest);
});

Просмотреть файл

@ -7,10 +7,6 @@ if (location.search === '?broken') {
var s = document.createElement('script');
s.src = 'http://example.com/dom/browser-element/mochitest/file_empty_script.js';
document.head.appendChild(s);
} else if (location.search === '?tracking') {
var img = document.createElement('img');
img.src = 'http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg';
document.body.appendChild(img);
}
</script>
</head>

Просмотреть файл

@ -126,6 +126,13 @@ class NavigateLoadListener final : public nsIWebProgressListener,
return NS_OK;
}
NS_IMETHOD
OnContentBlockingEvent(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
uint32_t aEvent) override {
MOZ_CRASH("Unexpected notification.");
return NS_OK;
}
NS_DECL_ISUPPORTS
};

Просмотреть файл

@ -122,6 +122,13 @@ class WebProgressListener final : public nsIWebProgressListener,
return NS_OK;
}
NS_IMETHOD
OnContentBlockingEvent(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
uint32_t aEvent) override {
MOZ_ASSERT(false, "Unexpected notification.");
return NS_OK;
}
private:
~WebProgressListener() {
if (mPromise) {

Просмотреть файл

@ -1974,7 +1974,14 @@ HTMLFormElement::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
HTMLFormElement::OnSecurityChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t state) {
nsIRequest* aRequest, uint32_t aState) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
HTMLFormElement::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aEvent) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}

Просмотреть файл

@ -506,7 +506,13 @@ nsHTMLDNSPrefetch::nsDeferrals::OnStatusChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
nsHTMLDNSPrefetch::nsDeferrals::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
uint32_t state) {
uint32_t aState) {
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDNSPrefetch::nsDeferrals::OnContentBlockingEvent(
nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aEvent) {
return NS_OK;
}

Просмотреть файл

@ -235,7 +235,14 @@ PresentationResponderLoadingCallback::OnStatusChange(
NS_IMETHODIMP
PresentationResponderLoadingCallback::OnSecurityChange(
nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t state) {
nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aState) {
// Do nothing.
return NS_OK;
}
NS_IMETHODIMP
PresentationResponderLoadingCallback::OnContentBlockingEvent(
nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aEvent) {
// Do nothing.
return NS_OK;
}

Просмотреть файл

@ -788,7 +788,20 @@ nsEditingSession::OnStatusChange(nsIWebProgress* aWebProgress,
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnSecurityChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t state) {
nsIRequest* aRequest, uint32_t aState) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}
/*---------------------------------------------------------------------------
OnContentBlockingEvent
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
uint32_t aEvent) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}

Просмотреть файл

@ -91,6 +91,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434998
{
},
onContentBlockingEvent : function(aWebProgress, aRequest, aEvent)
{
},
mEditor: null
};

Просмотреть файл

@ -97,6 +97,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607584
{
},
onContentBlockingEvent : function(aWebProgress, aRequest, aEvent)
{
},
mEditor: null
};

Просмотреть файл

@ -86,6 +86,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616590
{
},
onContentBlockingEvent : function(aWebProgress, aRequest, aEvent)
{
},
mEditor: null
};

Просмотреть файл

@ -95,6 +95,10 @@ adapted from test_bug607584.xul by Kent James <kent@caspia.com>
{
},
onContentBlockingEvent : function(aWebProgress, aRequest, aEvent)
{
},
mEditor: null
};

Просмотреть файл

@ -26,6 +26,7 @@ function printpreview() {
onSecurityChange: function(webProgress, request, state) { },
onStateChange: function(webProgress, request, stateFlags, status) { },
onStatusChange: function(webProgress, request, status, message) { },
onContentBlockingEvent: function(webProgress, request, event) { },
QueryInterface: function(iid) {
if (iid.equals(Ci.nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference))

Просмотреть файл

@ -26,6 +26,7 @@ function printpreview() {
onSecurityChange: function(webProgress, request, state) { },
onStateChange: function(webProgress, request, stateFlags, status) { },
onStatusChange: function(webProgress, request, status, message) { },
onContentBlockingEvent: function(webProgress, request, event) { },
QueryInterface: function(iid) {
if (iid.equals(Ci.nsIWebProgessListener) ||
iid.equals(Ci.nsISupportsWeakReference))

Просмотреть файл

@ -33,6 +33,7 @@ function printpreview() {
onSecurityChange: function(webProgress, request, state) { },
onStateChange: function(webProgress, request, stateFlags, status) { },
onStatusChange: function(webProgress, request, status, message) { },
onContentBlockingEvent: function(webProgress, request, event) { },
QueryInterface: function(iid) {
if (iid.equals(Ci.nsIWebProgressListener) ||
iid.equals(Ci.nsISupportsWeakReference))

Просмотреть файл

@ -144,6 +144,13 @@ RemotePrintJobChild::OnSecurityChange(nsIWebProgress* aProgress,
return NS_OK;
}
NS_IMETHODIMP
RemotePrintJobChild::OnContentBlockingEvent(nsIWebProgress* aProgress,
nsIRequest* aRequest,
uint32_t aEvent) {
return NS_OK;
}
// End of nsIWebProgressListener
RemotePrintJobChild::~RemotePrintJobChild() {}

Просмотреть файл

@ -2021,6 +2021,13 @@ nsPrintJob::OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
return NS_OK;
}
NS_IMETHODIMP
nsPrintJob::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aEvent) {
MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
return NS_OK;
}
//-------------------------------------------------------
void nsPrintJob::UpdateZoomRatio(nsPrintObject* aPO, bool aSetPixelScale) {

Просмотреть файл

@ -81,6 +81,10 @@ nsLDBBrowserContentListener.prototype = {
{
},
onContentBlockingEvent : function(aWebProgress, aRequest, aEvent)
{
},
// non-interface methods
setButtonEnabled : function(aButtonElement, aEnabled)
{

Просмотреть файл

@ -277,6 +277,7 @@ function printToPdf(callback) {
onLocationChange: function () {},
onStatusChange: function () {},
onSecurityChange: function () {},
onContentBlockingEvent: function () {},
});
}

Просмотреть файл

@ -0,0 +1,32 @@
Bug 1520760 - Fix AVX2 detection to ensure we have all required CPU parameters.
diff --git simd/i386/jsimdcpu.asm simd/i386/jsimdcpu.asm
--- simd/i386/jsimdcpu.asm
+++ simd/i386/jsimdcpu.asm
@@ -87,8 +87,10 @@ EXTN(jpeg_simd_cpu_support):
mov eax, 1
xor ecx, ecx
cpuid
- test ecx, 1<<27
+ test ecx, 1<<26
jz short .no_avx2 ; O/S does not support XSAVE
+ test ecx, 1<<27
+ jz short .no_avx2 ; O/S does not support OSXSAVE
test ecx, 1<<28
jz short .no_avx2 ; CPU does not support AVX2
diff --git simd/x86_64/jsimdcpu.asm simd/x86_64/jsimdcpu.asm
--- simd/x86_64/jsimdcpu.asm
+++ simd/x86_64/jsimdcpu.asm
@@ -53,8 +53,10 @@ EXTN(jpeg_simd_cpu_support):
mov rax, 1
xor rcx, rcx
cpuid
- test rcx, 1<<27
+ test rcx, 1<<26
jz short .return ; O/S does not support XSAVE
+ test rcx, 1<<27
+ jz short .return ; O/S does not support OSXSAVE
test rcx, 1<<28
jz short .return ; CPU does not support AVX2

Просмотреть файл

@ -87,8 +87,10 @@ EXTN(jpeg_simd_cpu_support):
mov eax, 1
xor ecx, ecx
cpuid
test ecx, 1<<27
test ecx, 1<<26
jz short .no_avx2 ; O/S does not support XSAVE
test ecx, 1<<27
jz short .no_avx2 ; O/S does not support OSXSAVE
test ecx, 1<<28
jz short .no_avx2 ; CPU does not support AVX2

Просмотреть файл

@ -53,8 +53,10 @@ EXTN(jpeg_simd_cpu_support):
mov rax, 1
xor rcx, rcx
cpuid
test rcx, 1<<27
test rcx, 1<<26
jz short .return ; O/S does not support XSAVE
test rcx, 1<<27
jz short .return ; O/S does not support OSXSAVE
test rcx, 1<<28
jz short .return ; CPU does not support AVX2

Просмотреть файл

@ -7,7 +7,7 @@ Contributors:
- James Zern (jzern at google dot com)
- Jan Engelhardt (jengelh at medozas dot de)
- Jehan (jehan at girinstud dot io)
- Johann (johann dot koenig at duck dot com)
- Johann Koenig (johann dot koenig at duck dot com)
- Jovan Zelincevic (jovan dot zelincevic at imgtec dot com)
- Jyrki Alakuijala (jyrki at google dot com)
- Konstantin Ivlev (tomskside at gmail dot com)

Просмотреть файл

@ -1,5 +1,7 @@
Changes made to pristine libwebp source by mozilla.org developers.
2018/01/21 -- Synced with libwebp-1.0.2 (bug 1521478).
2018/11/26 -- Synced with libwebp-1.0.1 (bug 1509878).
2018/10/04 -- Synced with libwebp-1.0.0 (bug #1294490).

Просмотреть файл

@ -1,3 +1,11 @@
- 1/14/2019: version 1.0.2
This is a binary compatible release.
* (Windows) unicode file support in the tools (linux and mac already had
support, issue #398)
* lossless encoder speedups
* lossy encoder speedup on ARM
* lossless multi-threaded security fix (chromium:917029)
- 11/2/2018: version 1.0.1
This is a binary compatible release.
* lossless encoder speedups

Просмотреть файл

@ -4,7 +4,7 @@
\__\__/\____/\_____/__/ ____ ___
/ _/ / \ \ / _ \/ _/
/ \_/ / / \ \ __/ \__
\____/____/\_____/_____/____/v1.0.1
\____/____/\_____/_____/____/v1.0.2
Description:
============
@ -136,6 +136,8 @@ cmake -DWEBP_BUILD_CWEBP=ON -DWEBP_BUILD_DWEBP=ON ../
or through your favorite interface (like ccmake or cmake-qt-gui).
Use option -DWEBP_UNICODE=ON for Unicode support on Windows (with chcp 65001).
Finally, once installed, you can also use WebP in your CMake project by doing:
find_package(WebP)

Просмотреть файл

@ -1,7 +1,7 @@
 __ __ ____ ____ ____ __ __ _ __ __
/ \\/ \/ _ \/ _ \/ _ \/ \ \/ \___/_ / _\
\ / __/ _ \ __/ / / (_/ /__
\__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.0.1
\__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.0.2
Description:

Просмотреть файл

@ -32,7 +32,7 @@ extern "C" {
// version numbers
#define DEC_MAJ_VERSION 1
#define DEC_MIN_VERSION 0
#define DEC_REV_VERSION 1
#define DEC_REV_VERSION 2
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
// Constraints are: We need to store one 16x16 block of luma samples (y),

Просмотреть файл

@ -25,7 +25,7 @@
#define DMUX_MAJ_VERSION 1
#define DMUX_MIN_VERSION 0
#define DMUX_REV_VERSION 1
#define DMUX_REV_VERSION 2
typedef struct {
size_t start_; // start location of the data

Просмотреть файл

@ -32,7 +32,7 @@ extern "C" {
// version numbers
#define ENC_MAJ_VERSION 1
#define ENC_MIN_VERSION 0
#define ENC_REV_VERSION 1
#define ENC_REV_VERSION 2
enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost

Просмотреть файл

@ -107,19 +107,6 @@ static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) {
PutLE16(data + 2, (int)(val >> 16));
}
// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either
// based on table or not. Can be used as fallback if clz() is not available.
#define WEBP_NEED_LOG_TABLE_8BIT
extern const uint8_t WebPLogTable8bit[256];
static WEBP_INLINE int WebPLog2FloorC(uint32_t n) {
int log_value = 0;
while (n >= 256) {
log_value += 8;
n >>= 8;
}
return log_value + WebPLogTable8bit[n];
}
// Returns (int)floor(log2(n)). n must be > 0.
// use GNU builtins where available.
#if defined(__GNUC__) && \
@ -138,6 +125,19 @@ static WEBP_INLINE int BitsLog2Floor(uint32_t n) {
return first_set_bit;
}
#else // default: use the C-version.
// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either
// based on table or not. Can be used as fallback if clz() is not available.
#define WEBP_NEED_LOG_TABLE_8BIT
extern const uint8_t WebPLogTable8bit[256];
static WEBP_INLINE int WebPLog2FloorC(uint32_t n) {
int log_value = 0;
while (n >= 256) {
log_value += 8;
n >>= 8;
}
return log_value + WebPLogTable8bit[n];
}
static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return WebPLog2FloorC(n); }
#endif

Просмотреть файл

@ -42,6 +42,12 @@ WEBP_EXTERN int WebPGetDecoderVersion(void);
// This function will also validate the header, returning true on success,
// false otherwise. '*width' and '*height' are only valid on successful return.
// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.
// Note: The following chunk sequences (before the raw VP8/VP8L data) are
// considered valid by this function:
// RIFF + VP8(L)
// RIFF + VP8X + (optional chunks) + VP8(L)
// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose.
// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose.
WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size,
int* width, int* height);
@ -425,6 +431,12 @@ WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal(
// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns
// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the
// features from headers. Returns error in other cases.
// Note: The following chunk sequences (before the raw VP8/VP8L data) are
// considered valid by this function:
// RIFF + VP8(L)
// RIFF + VP8X + (optional chunks) + VP8(L)
// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose.
// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose.
static WEBP_INLINE VP8StatusCode WebPGetFeatures(
const uint8_t* data, size_t data_size,
WebPBitstreamFeatures* features) {

Просмотреть файл

@ -19,7 +19,7 @@ tag=${2-HEAD}
cd $srcdir/libjpeg
cp win/jsimdcfg.inc simd/
revert_files="1050342.diff assembly-tables.diff externalize-table.diff jconfig.h jconfigint.h jpeg_nbits_table.c moz.build MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
revert_files="1050342.diff assembly-tables.diff externalize-table.diff 1520760-avx2-detection.diff jconfig.h jconfigint.h jpeg_nbits_table.c moz.build MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
if test -d ${topsrcdir}/.hg; then
hg revert --no-backup $revert_files
elif test -d ${topsrcdir}/.git; then
@ -30,3 +30,4 @@ patch -p0 -i mozilla.diff
patch -p0 -i 1050342.diff
patch -p3 -i externalize-table.diff
patch -p3 -i assembly-tables.diff
patch -p0 -i 1520760-avx2-detection.diff

Просмотреть файл

@ -91,8 +91,6 @@ public class SiteIdentity {
MixedMode.class, mode.getString("mixed_display"), MixedMode.UNKNOWN);
mMixedModeActive = getEnumValue(
MixedMode.class, mode.getString("mixed_active"), MixedMode.UNKNOWN);
mTrackingMode = getEnumValue(
TrackingMode.class, mode.getString("tracking"), TrackingMode.UNKNOWN);
if (!mode.containsKey("identity") || !identityData.containsKey("origin")) {
resetIdentity();
@ -112,6 +110,10 @@ public class SiteIdentity {
mSecurityException = identityData.getBoolean("securityException");
}
/* package */ void updateTrackingMode(final String trackingEvent) {
mTrackingMode = getEnumValue(TrackingMode.class, trackingEvent, TrackingMode.UNKNOWN);
}
public SecurityMode getSecurityMode() {
return mSecurityMode;
}

Просмотреть файл

@ -504,6 +504,10 @@ public class Tab {
mSiteIdentity.update(identityData);
}
public void updateTracking(String statusCode) {
mSiteIdentity.updateTrackingMode(statusCode);
}
public void setSiteLogins(SiteLogins siteLogins) {
mSiteLogins = siteLogins;
}

Просмотреть файл

@ -154,6 +154,7 @@ public class Tabs implements BundleEventListener {
"Content:LocationChange",
"Content:SubframeNavigation",
"Content:SecurityChange",
"Content:ContentBlockingEvent",
"Content:StateChange",
"Content:LoadError",
"Content:DOMContentLoaded",
@ -620,6 +621,10 @@ public class Tabs implements BundleEventListener {
tab.updatePageAction();
notifyListeners(tab, TabEvents.SECURITY_CHANGE);
} else if ("Content:ContentBlockingEvent".equals(event)) {
tab.updateTracking(message.getString("tracking"));
notifyListeners(tab, TabEvents.TRACKING_CHANGE);
} else if ("Content:StateChange".equals(event)) {
final int state = message.getInt("state");
if ((state & GeckoAppShell.WPL_STATE_IS_NETWORK) == 0) {
@ -764,6 +769,7 @@ public class Tabs implements BundleEventListener {
PAGE_SHOW,
LINK_FEED,
SECURITY_CHANGE,
TRACKING_CHANGE,
DESKTOP_MODE_CHANGE,
RECORDING_CHANGE,
BOOKMARK_ADDED,

Просмотреть файл

@ -525,6 +525,7 @@ public abstract class BrowserToolbar extends ThemedRelativeLayout
break;
case SECURITY_CHANGE:
case TRACKING_CHANGE:
flags.add(UpdateFlags.SITE_IDENTITY);
break;
}

Просмотреть файл

@ -62,6 +62,7 @@ var PrintHelper = {
onLocationChange: function() {},
onStatusChange: function() {},
onSecurityChange: function() {},
onContentBlockingEvent: function() {},
});
});
},

Просмотреть файл

@ -3772,7 +3772,8 @@ Tab.prototype = {
let flags = Ci.nsIWebProgress.NOTIFY_STATE_ALL |
Ci.nsIWebProgress.NOTIFY_LOCATION |
Ci.nsIWebProgress.NOTIFY_SECURITY;
Ci.nsIWebProgress.NOTIFY_SECURITY |
Ci.nsIWebProgress.NOTIFY_CONTENT_BLOCKING;
this.filter = Cc["@mozilla.org/appshell/component/browser-status-filter;1"].createInstance(Ci.nsIWebProgress);
this.filter.addProgressListener(this, flags)
this.browser.addProgressListener(this.filter, flags);
@ -4756,6 +4757,26 @@ Tab.prototype = {
GlobalEventDispatcher.sendRequest(message);
},
// Cache last tracking event to limit firings and only propagate changes
_tracking: null,
onContentBlockingEvent: function(aWebProgress, aRequest, aState) {
let trackingMode = IdentityHandler.getTrackingMode(aState, this.browser);
if (this._tracking == trackingMode) {
return;
} else {
this._tracking = trackingMode;
}
let message = {
type: "Content:ContentBlockingEvent",
tabID: this.id,
tracking: trackingMode
};
GlobalEventDispatcher.sendRequest(message);
},
OnHistoryNewEntry: function(newURI, oldIndex) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange");
},
@ -5815,14 +5836,12 @@ var IdentityHandler = {
let identityMode = this.getIdentityMode(aState, this._uri);
let mixedDisplay = this.getMixedDisplayMode(aState);
let mixedActive = this.getMixedActiveMode(aState);
let trackingMode = this.getTrackingMode(aState, aBrowser);
let result = {
origin: locationObj.origin,
mode: {
identity: identityMode,
mixed_display: mixedDisplay,
mixed_active: mixedActive,
tracking: trackingMode
}
};

Просмотреть файл

@ -12,7 +12,7 @@ class GeckoViewTrackingProtection extends GeckoViewModule {
onEnable() {
debug `onEnable`;
const flags = Ci.nsIWebProgress.NOTIFY_SECURITY;
const flags = Ci.nsIWebProgress.NOTIFY_CONTENT_BLOCKING;
this.progressFilter =
Cc["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Ci.nsIWebProgress);
@ -20,10 +20,10 @@ class GeckoViewTrackingProtection extends GeckoViewModule {
this.browser.addProgressListener(this.progressFilter, flags);
}
onSecurityChange(aWebProgress, aRequest, aState) {
debug `onSecurityChange`;
onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
debug `onContentBlockingEvent`;
if (!(aState & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) ||
if (!(aEvent & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) ||
!aRequest || !(aRequest instanceof Ci.nsIClassifiedChannel)) {
return;
}

Просмотреть файл

@ -14,7 +14,7 @@ import org.mozilla.gecko.util.EventCallback;
import org.mozilla.gecko.util.GeckoBundle;
public class testTrackingProtection extends JavascriptTest implements BundleEventListener {
private String mLastTracking;
private String mLastTracking = "unknown"; // Default value if no events received yet
public testTrackingProtection() {
super("testTrackingProtection.js");
@ -23,16 +23,14 @@ public class testTrackingProtection extends JavascriptTest implements BundleEven
@Override // BundleEventListener
public void handleMessage(final String event, final GeckoBundle message,
final EventCallback callback) {
if ("Content:SecurityChange".equals(event)) {
final GeckoBundle identity = message.getBundle("identity");
final GeckoBundle mode = identity.getBundle("mode");
mLastTracking = mode.getString("tracking");
if ("Content:ContentBlockingEvent".equals(event)) {
mLastTracking = message.getString("tracking");
mAsserter.dumpLog("Security change (tracking): " + mLastTracking);
} else if ("Test:Expected".equals(event)) {
final String expected = message.getString("expected");
mAsserter.dumpLog("Testing (tracking): 2" + mLastTracking + " = " + expected);
mAsserter.is(mLastTracking, expected, "Tracking matched expectation");
mAsserter.dumpLog("Testing (tracking): " + mLastTracking + " = " + expected);
}
}
@ -41,7 +39,7 @@ public class testTrackingProtection extends JavascriptTest implements BundleEven
super.setUp();
EventDispatcher.getInstance().registerUiThreadListener(this,
"Content:SecurityChange",
"Content:ContentBlockingEvent",
"Test:Expected");
}
@ -50,7 +48,7 @@ public class testTrackingProtection extends JavascriptTest implements BundleEven
super.tearDown();
EventDispatcher.getInstance().unregisterUiThreadListener(this,
"Content:SecurityChange",
"Content:ContentBlockingEvent",
"Test:Expected");
}
}

Просмотреть файл

@ -36,7 +36,7 @@ function promiseLoadEvent(browser, url, eventType = "load", runBeforeLoad) {
}
// Test that the Tracking Protection is active and has the correct state when
// tracking content is blocked (Bug 1063831)
// tracking content is blocked (Bug 1063831 + Bug 1520520)
// Code is mostly stolen from:
// http://dxr.mozilla.org/mozilla-central/source/browser/base/content/test/general/browser_trackingUI.js

Просмотреть файл

@ -15,6 +15,7 @@ interface nsISecureBrowserUI : nsISupports
void init(in nsIDocShell docShell);
readonly attribute unsigned long state;
readonly attribute unsigned long contentBlockingEvent;
readonly attribute nsITransportSecurityInfo secInfo;
};

Просмотреть файл

@ -19,6 +19,15 @@ interface nsISecurityEventSink : nsISupports
*/
void onSecurityChange(in nsISupports i_Context, in unsigned long state);
/**
* Fired when a content blocking event occurs during the time
* when a document is alive. This interface should be called
* by Gecko to notify nsIWebProgressListeners that there is a
* new content blocking event. Content blocking events are in
* nsIWebProgressListeners.idl.
*/
void onContentBlockingEvent(in nsISupports i_Context, in unsigned long event);
};

Просмотреть файл

@ -84,7 +84,7 @@ LazyLogModule UrlClassifierCommon::sLog("nsChannelClassifier");
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
pwin->NotifyContentBlockingState(aBlockedReason, aChannel, true, uri);
pwin->NotifyContentBlockingEvent(aBlockedReason, aChannel, true, uri);
}
/* static */ bool UrlClassifierCommon::ShouldEnableClassifier(

Просмотреть файл

@ -22,7 +22,7 @@ using namespace mozilla;
LazyLogModule gSecureBrowserUILog("nsSecureBrowserUI");
nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mState(0) {
nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mState(0), mEvent(0) {
MOZ_ASSERT(NS_IsMainThread());
}
@ -67,13 +67,30 @@ nsSecureBrowserUIImpl::GetState(uint32_t* aState) {
// With respect to mixed content and tracking protection, we won't know when
// the state of our document (or a subdocument) has changed, so we ask the
// docShell.
CheckForBlockedContent();
CheckForMixedContent();
MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" mState: %x", mState));
*aState = mState;
return NS_OK;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::GetContentBlockingEvent(uint32_t* aEvent) {
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_ARG(aEvent);
MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug,
("GetContentBlockingEvent %p", this));
// With respect to mixed content and tracking protection, we won't know when
// the state of our document (or a subdocument) has changed, so we ask the
// docShell.
CheckForContentBlockingEvents();
MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" mEvent: %x", mEvent));
*aEvent = mEvent;
return NS_OK;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::GetSecInfo(nsITransportSecurityInfo** result) {
MOZ_ASSERT(NS_IsMainThread());
@ -85,11 +102,11 @@ nsSecureBrowserUIImpl::GetSecInfo(nsITransportSecurityInfo** result) {
return NS_OK;
}
// Ask the docShell if we've blocked or loaded any mixed or tracking content.
void nsSecureBrowserUIImpl::CheckForBlockedContent() {
already_AddRefed<dom::Document>
nsSecureBrowserUIImpl::PrepareForContentChecks() {
nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mDocShell);
if (!docShell) {
return;
return nullptr;
}
// For content docShells, the mixed content security state is set on the root
@ -104,11 +121,17 @@ void nsSecureBrowserUIImpl::CheckForBlockedContent() {
"No document shell root tree item from document shell tree item!");
docShell = do_QueryInterface(sameTypeRoot);
if (!docShell) {
return;
return nullptr;
}
}
RefPtr<dom::Document> doc = docShell->GetDocument();
return doc.forget();
}
// Ask the docShell if we've blocked or loaded any mixed content.
void nsSecureBrowserUIImpl::CheckForMixedContent() {
RefPtr<dom::Document> doc = PrepareForContentChecks();
if (!doc) {
// If the docshell has no document, then there is no need to update mState.
return;
@ -137,34 +160,43 @@ void nsSecureBrowserUIImpl::CheckForBlockedContent() {
mState |= STATE_BLOCKED_MIXED_DISPLAY_CONTENT;
}
}
}
// Ask the docShell if we have any content blocking events.
void nsSecureBrowserUIImpl::CheckForContentBlockingEvents() {
RefPtr<dom::Document> doc = PrepareForContentChecks();
if (!doc) {
// If the docshell has no document, then there is no need to update mState.
return;
}
// Has tracking content been blocked or loaded?
if (doc->GetHasTrackingContentBlocked()) {
mState |= STATE_BLOCKED_TRACKING_CONTENT;
mEvent |= STATE_BLOCKED_TRACKING_CONTENT;
}
if (doc->GetHasTrackingContentLoaded()) {
mState |= STATE_LOADED_TRACKING_CONTENT;
mEvent |= STATE_LOADED_TRACKING_CONTENT;
}
if (doc->GetHasCookiesBlockedByPermission()) {
mState |= STATE_COOKIES_BLOCKED_BY_PERMISSION;
mEvent |= STATE_COOKIES_BLOCKED_BY_PERMISSION;
}
if (doc->GetHasTrackingCookiesBlocked()) {
mState |= STATE_COOKIES_BLOCKED_TRACKER;
mEvent |= STATE_COOKIES_BLOCKED_TRACKER;
}
if (doc->GetHasForeignCookiesBlocked()) {
mState |= STATE_COOKIES_BLOCKED_FOREIGN;
mEvent |= STATE_COOKIES_BLOCKED_FOREIGN;
}
if (doc->GetHasAllCookiesBlocked()) {
mState |= STATE_COOKIES_BLOCKED_ALL;
mEvent |= STATE_COOKIES_BLOCKED_ALL;
}
if (doc->GetHasCookiesLoaded()) {
mState |= STATE_COOKIES_LOADED;
mEvent |= STATE_COOKIES_LOADED;
}
}
@ -321,7 +353,7 @@ nsresult nsSecureBrowserUIImpl::UpdateStateAndSecurityInfo(nsIChannel* channel,
// that nsIWebProgress. We ignore notifications from children because they don't
// change the top-level state (if children load mixed or tracking content, the
// docShell will know and will tell us in GetState when we call
// CheckForBlockedContent).
// CheckForMixedContent).
// When we receive a notification from the top-level nsIWebProgress, we extract
// any relevant security information and set our state accordingly. We then call
// OnSecurityChange on the docShell corresponding to the nsIWebProgress we were
@ -357,6 +389,7 @@ nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress,
}
mState = 0;
mEvent = 0;
mTopLevelSecurityInfo = nullptr;
if (aFlags & LOCATION_CHANGE_ERROR_PAGE) {
@ -422,3 +455,9 @@ nsresult nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress*, nsIRequest*,
MOZ_ASSERT_UNREACHABLE("Should have been excluded in AddProgressListener()");
return NS_OK;
}
nsresult nsSecureBrowserUIImpl::OnContentBlockingEvent(nsIWebProgress*,
nsIRequest*, uint32_t) {
MOZ_ASSERT_UNREACHABLE("Should have been excluded in AddProgressListener()");
return NS_OK;
}

Просмотреть файл

@ -14,6 +14,12 @@
class nsITransportSecurityInfo;
class nsIChannel;
namespace mozilla {
namespace dom {
class Document;
}
} // namespace mozilla
#define NS_SECURE_BROWSER_UI_CID \
{ \
0xcc75499a, 0x1dd1, 0x11b2, { \
@ -34,13 +40,17 @@ class nsSecureBrowserUIImpl : public nsISecureBrowserUI,
protected:
virtual ~nsSecureBrowserUIImpl(){};
// Do mixed content and tracking protection checks. May update mState.
void CheckForBlockedContent();
already_AddRefed<mozilla::dom::Document> PrepareForContentChecks();
// Do mixed content checks. May update mState.
void CheckForMixedContent();
// Do Content Blocking checks. May update mEvent.
void CheckForContentBlockingEvents();
// Given some information about a request from an OnLocationChange event,
// update mState and mTopLevelSecurityInfo.
nsresult UpdateStateAndSecurityInfo(nsIChannel* channel, nsIURI* uri);
uint32_t mState;
uint32_t mEvent;
nsWeakPtr mDocShell;
nsWeakPtr mWebProgress;
nsCOMPtr<nsITransportSecurityInfo> mTopLevelSecurityInfo;

Просмотреть файл

@ -0,0 +1,41 @@
# HG changeset patch
# User Tom Ritter <tom@mozilla.com>
# Date 1526498300 18000
# Wed May 16 14:18:20 2018 -0500
# Node ID dd3f4940aeb0c4e00e8bcf1c238f2355ad793489
# Parent cf646c80b9545db7ab548f88a482378734ee2f78
Bug 1462100 Cast to void* to avoid conversion errors on MinGW, which does not do the automatic conversion like msvc r?bobowen
MozReview-Commit-ID: 8fO9Nu9gaxh
diff --git a/security/sandbox/chromium/sandbox/win/src/interception.h b/security/sandbox/chromium/sandbox/win/src/interception.h
--- a/security/sandbox/chromium/sandbox/win/src/interception.h
+++ b/security/sandbox/chromium/sandbox/win/src/interception.h
@@ -264,25 +264,25 @@ class InterceptionManager {
#define MAKE_SERVICE_NAME(service) &Target##service##64
#else
#define MAKE_SERVICE_NAME(service) &Target##service
#endif
#define ADD_NT_INTERCEPTION(service, id, num_params) \
AddToPatchedFunctions(kNtdllName, #service, \
sandbox::INTERCEPTION_SERVICE_CALL, \
- MAKE_SERVICE_NAME(service), id)
+ (void*)MAKE_SERVICE_NAME(service), id)
#define INTERCEPT_NT(manager, service, id, num_params) \
manager->ADD_NT_INTERCEPTION(service, id, num_params)
// When intercepting the EAT it is important that the patched version of the
// function not call any functions imported from system libraries unless
// |TargetServices::InitCalled()| returns true, because it is only then that
// we are guaranteed that our IAT has been initialized.
#define INTERCEPT_EAT(manager, dll, function, id, num_params) \
manager->AddToPatchedFunctions(dll, #function, sandbox::INTERCEPTION_EAT, \
- MAKE_SERVICE_NAME(function), id)
+ (void*)MAKE_SERVICE_NAME(function), id)
#endif // SANDBOX_EXPORTS
} // namespace sandbox
#endif // SANDBOX_SRC_INTERCEPTION_H_

Просмотреть файл

@ -18,5 +18,6 @@ mingw_operator_new.patch
mingw_cast_getprocaddress.patch
mingw_capitalization.patch
mingw_disable_one_try.patch
mingw_noexports_casts.patch
mingw_offsetof.patch
add_aarch64_windows_support.patch

Просмотреть файл

@ -269,7 +269,7 @@ class InterceptionManager {
#define ADD_NT_INTERCEPTION(service, id, num_params) \
AddToPatchedFunctions(kNtdllName, #service, \
sandbox::INTERCEPTION_SERVICE_CALL, \
MAKE_SERVICE_NAME(service), id)
(void*)MAKE_SERVICE_NAME(service), id)
#define INTERCEPT_NT(manager, service, id, num_params) \
manager->ADD_NT_INTERCEPTION(service, id, num_params)
@ -280,7 +280,7 @@ class InterceptionManager {
// we are guaranteed that our IAT has been initialized.
#define INTERCEPT_EAT(manager, dll, function, id, num_params) \
manager->AddToPatchedFunctions(dll, #function, sandbox::INTERCEPTION_EAT, \
MAKE_SERVICE_NAME(function), id)
(void*)MAKE_SERVICE_NAME(function), id)
#endif // SANDBOX_EXPORTS
} // namespace sandbox

Просмотреть файл

@ -434,6 +434,7 @@ var BrowserTestUtils = {
onSecurityChange() {},
onStatusChange() {},
onLocationChange() {},
onContentBlockingEvent() {},
QueryInterface: ChromeUtils.generateQI([
Ci.nsIWebProgressListener,
Ci.nsIWebProgressListener2,

Просмотреть файл

@ -422,4 +422,5 @@ PrintingListener.prototype = {
onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {},
onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {},
onSecurityChange(aWebProgress, aRequest, aState) {},
onContentBlockingEvent(aWebProgress, aRequest, aEvent) {},
};

Просмотреть файл

@ -623,7 +623,7 @@ AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
nsIChannel* channel =
pwin->GetCurrentInnerWindow()->GetExtantDoc()->GetChannel();
pwin->NotifyContentBlockingState(blockReason, channel, false, trackingURI);
pwin->NotifyContentBlockingEvent(blockReason, channel, false, trackingURI);
ReportUnblockingConsole(parentWindow, NS_ConvertUTF8toUTF16(trackingOrigin),
NS_ConvertUTF8toUTF16(origin), aReason);
@ -1483,12 +1483,12 @@ nsresult AntiTrackingCommon::IsOnContentBlockingAllowList(
aChannel->GetURI(getter_AddRefs(uri));
if (aDecision == BlockingDecision::eBlock) {
pwin->NotifyContentBlockingState(aRejectedReason, aChannel, true, uri);
pwin->NotifyContentBlockingEvent(aRejectedReason, aChannel, true, uri);
ReportBlockingToConsole(pwin, uri, aRejectedReason);
}
pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
pwin->NotifyContentBlockingEvent(nsIWebProgressListener::STATE_COOKIES_LOADED,
aChannel, false, uri);
}
@ -1532,12 +1532,12 @@ nsresult AntiTrackingCommon::IsOnContentBlockingAllowList(
nsIURI* uri = document->GetDocumentURI();
if (aDecision == BlockingDecision::eBlock) {
pwin->NotifyContentBlockingState(aRejectedReason, channel, true, uri);
pwin->NotifyContentBlockingEvent(aRejectedReason, channel, true, uri);
ReportBlockingToConsole(pwin, uri, aRejectedReason);
}
pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
pwin->NotifyContentBlockingEvent(nsIWebProgressListener::STATE_COOKIES_LOADED,
channel, false, uri);
}

Просмотреть файл

@ -18,13 +18,14 @@ support-files =
3rdPartyOpenUI.html
empty.js
popup.html
server.sjs
storageAccessAPIHelpers.js
!/browser/modules/test/browser/head.js
[browser_allowListSeparationInPrivateAndNormalWindows.js]
skip-if = os == "mac" && !debug # Bug 1503778
[browser_backgroundImageAssertion.js]
[browser_blockingCookies.js]
support-files = server.sjs
[browser_blockingDOMCache.js]
skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937
[browser_blockingIndexedDb.js]

Просмотреть файл

@ -9,12 +9,13 @@ const BLOCK = 0;
const ALLOW = 1;
const ALLOW_ON_ANY_SITE = 2;
async function testDoorHanger(choice, showPrompt, topPage, maxConcurrent) {
async function testDoorHanger(choice, showPrompt, useEscape, topPage, maxConcurrent) {
info(`Running doorhanger test with choice #${choice}, showPrompt: ${showPrompt} and ` +
`topPage: ${topPage}, maxConcurrent: ${maxConcurrent}`);
`useEscape: ${useEscape}, topPage: ${topPage}, maxConcurrent: ${maxConcurrent}`);
if (!showPrompt) {
is(choice, ALLOW, "When not showing a prompt, we can only auto-grant");
ok(!useEscape, "When not showing a prompt, we should not be trying to use the Esc key");
}
await SpecialPowers.flushPrefEnv();
@ -50,6 +51,7 @@ async function testDoorHanger(choice, showPrompt, topPage, maxConcurrent) {
addEventListener("message", function onMessage(e) {
if (e.data.startsWith("choice:")) {
window.choice = e.data.split(":")[1];
window.useEscape = e.data.split(":")[3];
removeEventListener("message", onMessage);
resolve();
}
@ -131,7 +133,11 @@ async function testDoorHanger(choice, showPrompt, topPage, maxConcurrent) {
Assert.ok(notification, "Should have gotten the notification");
if (choice == BLOCK) {
if (useEscape) {
EventUtils.synthesizeKey("KEY_Escape", {}, window);
} else {
await clickMainAction();
}
} else if (choice == ALLOW) {
await clickSecondaryAction(choice - 1);
} else if (choice == ALLOW_ON_ANY_SITE) {
@ -147,6 +153,7 @@ async function testDoorHanger(choice, showPrompt, topPage, maxConcurrent) {
{ page: url,
callback: runChecks.toString(),
choice,
useEscape,
},
async function(obj) {
await new content.Promise(resolve => {
@ -174,7 +181,8 @@ async function testDoorHanger(choice, showPrompt, topPage, maxConcurrent) {
}
if (event.data == "getchoice") {
ifr.contentWindow.postMessage("choice:" + obj.choice, "*");
ifr.contentWindow.postMessage("choice:" + obj.choice +
":useEscape:" + obj.useEscape, "*");
return;
}
@ -303,16 +311,19 @@ async function cleanUp() {
async function runRound(topPage, showPrompt, maxConcurrent) {
if (showPrompt) {
await preparePermissionsFromOtherSites(topPage);
await testDoorHanger(BLOCK, showPrompt, topPage, maxConcurrent);
await testDoorHanger(BLOCK, showPrompt, true, topPage, maxConcurrent);
await cleanUp();
await preparePermissionsFromOtherSites(topPage);
await testDoorHanger(ALLOW, showPrompt, topPage, maxConcurrent);
await testDoorHanger(BLOCK, showPrompt, false, topPage, maxConcurrent);
await cleanUp();
await preparePermissionsFromOtherSites(topPage);
await testDoorHanger(ALLOW_ON_ANY_SITE, showPrompt, topPage, maxConcurrent);
await testDoorHanger(ALLOW, showPrompt, false, topPage, maxConcurrent);
await cleanUp();
await preparePermissionsFromOtherSites(topPage);
await testDoorHanger(ALLOW_ON_ANY_SITE, showPrompt, false, topPage, maxConcurrent);
} else {
await preparePermissionsFromOtherSites(topPage);
await testDoorHanger(ALLOW, showPrompt, topPage, maxConcurrent);
await testDoorHanger(ALLOW, showPrompt, false, topPage, maxConcurrent);
}
await cleanUp();
}

Просмотреть файл

@ -299,8 +299,8 @@ this.AntiTracking = {
let cookieBlocked = 0;
let listener = {
onSecurityChange(webProgress, request, state) {
if ((state & options.expectedBlockingNotifications)) {
onContentBlockingEvent(webProgress, request, event) {
if ((event & options.expectedBlockingNotifications)) {
++cookieBlocked;
}
},

Просмотреть файл

@ -706,6 +706,16 @@ nsWebBrowser::OnSecurityChange(nsIWebProgress* aWebProgress,
return NS_OK;
}
NS_IMETHODIMP
nsWebBrowser::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aEvent) {
if (mProgressListener) {
return mProgressListener->OnContentBlockingEvent(aWebProgress, aRequest,
aEvent);
}
return NS_OK;
}
//*****************************************************************************
// nsWebBrowser::nsIWebBrowserPersist
//*****************************************************************************

Просмотреть файл

@ -2678,6 +2678,7 @@ this.DownloadPDFSaver.prototype = {
onLocationChange() {},
onStatusChange() {},
onSecurityChange() {},
onContentBlockingEvent() {},
});
});
} finally {

Просмотреть файл

@ -167,6 +167,8 @@ DownloadLegacyTransfer.prototype = {
onSecurityChange() { },
onContentBlockingEvent() { },
// nsIWebProgressListener2
onProgressChange64: function DLT_onProgressChange64(aWebProgress, aRequest,
aCurSelfProgress,

Просмотреть файл

@ -60,6 +60,7 @@ var progressListener = {
onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {},
onSecurityChange(aWebProgress, aRequest, state) {},
onContentBlockingEvent(aWebProgress, aRequest, event) {},
onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {
if (aMessage)

Просмотреть файл

@ -144,6 +144,10 @@ var progressListener = {
// we can ignore this notification
},
onContentBlockingEvent(aWebProgress, aRequest, event) {
// we can ignore this notification
},
QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
"nsISupportsWeakReference"]),
};

Просмотреть файл

@ -88,6 +88,13 @@ PrintProgressDialogChild::OnSecurityChange(nsIWebProgress* aProgress,
return NS_OK;
}
NS_IMETHODIMP
PrintProgressDialogChild::OnContentBlockingEvent(nsIWebProgress* aProgress,
nsIRequest* aRequest,
uint32_t aEvent) {
return NS_OK;
}
// nsIPrintProgressParams
NS_IMETHODIMP

Просмотреть файл

@ -245,7 +245,12 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
uint32_t state) {
uint32_t aState) {
return NS_OK;
}
NS_IMETHODIMP nsPrintProgress::OnContentBlockingEvent(
nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aEvent) {
return NS_OK;
}

Просмотреть файл

@ -205,11 +205,24 @@ nsPrintingPromptService::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsPrintingPromptService::OnSecurityChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
uint32_t state) {
uint32_t aState) {
#if !defined(XP_MACOSX)
if (mWebProgressListener) {
return mWebProgressListener->OnSecurityChange(aWebProgress, aRequest,
state);
aState);
}
#endif
return NS_OK;
}
NS_IMETHODIMP
nsPrintingPromptService::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
uint32_t aEvent) {
#if !defined(XP_MACOSX)
if (mWebProgressListener) {
return mWebProgressListener->OnContentBlockingEvent(aWebProgress, aRequest,
aEvent);
}
#endif
return NS_OK;

Просмотреть файл

@ -241,6 +241,15 @@ nsBrowserStatusFilter::OnSecurityChange(nsIWebProgress *aWebProgress,
return mListener->OnSecurityChange(aWebProgress, aRequest, aState);
}
NS_IMETHODIMP
nsBrowserStatusFilter::OnContentBlockingEvent(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
uint32_t aEvent) {
if (!mListener) return NS_OK;
return mListener->OnContentBlockingEvent(aWebProgress, aRequest, aEvent);
}
//-----------------------------------------------------------------------------
// nsBrowserStatusFilter::nsIWebProgressListener2
//-----------------------------------------------------------------------------

Просмотреть файл

@ -194,12 +194,12 @@ function testOnWindow(aTestData) {
let browser = win.gBrowser.selectedBrowser;
let wp = win.gBrowser.contentWindow.docShell.QueryInterface(Ci.nsIWebProgress);
let progressListener = {
onSecurityChange(aWebProgress, aRequest, aState) {
onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
expected = aTestData.reportUrl;
},
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
};
wp.addProgressListener(progressListener, wp.NOTIFY_SECURITY);
wp.addProgressListener(progressListener, wp.NOTIFY_CONTENT_BLOCKING);
await BrowserTestUtils.loadURI(browser, aTestData.url);
await BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded");

Просмотреть файл

@ -45,6 +45,7 @@ function one_test(delay, continuation) {
onLocationChange() {},
onStatusChange() {},
onSecurityChange() {},
onContentBlockingEvent() {},
onStateChange(_wbp, _req, state, _status) {
if ((state & Ci.nsIWebProgressListener.STATE_STOP) == 0) {
return;

Просмотреть файл

@ -41,6 +41,7 @@ iframe.onload = function iframe_onload1() {
onLocationChange() {},
onStatusChange() {},
onSecurityChange() {},
onContentBlockingEvent() {},
onStateChange: function wbp_stateChange(_wbp, _req, state, status) {
if ((state & Ci.nsIWebProgressListener.STATE_STOP) == 0) {
return;

Просмотреть файл

@ -47,6 +47,7 @@ iframe.onload = function iframe_onload1() {
onLocationChange() {},
onStatusChange() {},
onSecurityChange() {},
onContentBlockingEvent() {},
onStateChange: wbp_stateChange,
};
SimpleTest.registerCleanupFunction(cleanUp);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше