Merge autoland to central, a=merge

This commit is contained in:
Wes Kocher 2017-03-29 15:20:43 -07:00
Родитель 317d304694 7c4e46f7ce
Коммит d6c321a6a9
149 изменённых файлов: 4718 добавлений и 1945 удалений

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

@ -24,9 +24,9 @@
"size": 12072532
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -1179,8 +1179,14 @@ var gBrowserInit = {
// have been initialized.
Services.obs.notifyObservers(window, "browser-window-before-show", "");
let isResistFingerprintingEnabled = gPrefService.getBoolPref("privacy.resistFingerprinting");
// Set a sane starting width/height for all resolutions on new profiles.
if (!document.documentElement.hasAttribute("width")) {
if (isResistFingerprintingEnabled) {
// When the fingerprinting resistance is enabled, making sure that we don't
// have a maximum window to interfere with generating rounded window dimensions.
document.documentElement.setAttribute("sizemode", "normal");
} else if (!document.documentElement.hasAttribute("width")) {
const TARGET_WIDTH = 1280;
const TARGET_HEIGHT = 1040;
let width = Math.min(screen.availWidth * .9, TARGET_WIDTH);
@ -3182,7 +3188,7 @@ var BrowserOnClick = {
let title;
if (reason === "malware") {
let reportUrl = gSafeBrowsing.getReportURL("MalwareMistake", blockedInfo);
title = gNavigatorBundle.getString("safebrowsing.reportedAttackSite");
// There's no button if we can not get report url, for example if the provider
// of blockedInfo is not Google
if (reportUrl) {
@ -3196,7 +3202,7 @@ var BrowserOnClick = {
}
} else if (reason === "phishing") {
let reportUrl = gSafeBrowsing.getReportURL("PhishMistake", blockedInfo);
title = gNavigatorBundle.getString("safebrowsing.deceptiveSite");
// There's no button if we can not get report url, for example if the provider
// of blockedInfo is not Google
if (reportUrl) {

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

@ -18,6 +18,7 @@ DIRS += [
'places',
'preferences',
'privatebrowsing',
'resistfingerprinting',
'search',
'sessionstore',
'shell',

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

@ -26,7 +26,7 @@ add_task(function* test_private_popup_window_opens_private_tabs() {
// Sanity check - this browser better be private.
ok(PrivateBrowsingUtils.isWindowPrivate(privWin),
"Could not open a private browsing window.");
"Opened a private browsing window.");
// First, open a private browsing window, and load our
// testing page.
@ -36,17 +36,17 @@ add_task(function* test_private_popup_window_opens_private_tabs() {
// Next, click on the link in the testing page, and ensure
// that a private popup window is opened.
let openedPromise = BrowserTestUtils.waitForNewWindow();
let openedPromise = BrowserTestUtils.waitForNewWindow(true, POPUP_LINK);
yield BrowserTestUtils.synthesizeMouseAtCenter("#first", {}, privBrowser);
let popupWin = yield openedPromise;
ok(PrivateBrowsingUtils.isWindowPrivate(popupWin),
"Popup window was not private.");
"Popup window was private.");
// Now click on the link in the popup, and ensure that a new
// tab is opened in the original private browsing window.
let newTabPromise = BrowserTestUtils.waitForNewTab(privWin.gBrowser);
let popupBrowser = popupWin.gBrowser.selectedBrowser;
yield BrowserTestUtils.browserLoaded(popupBrowser);
yield BrowserTestUtils.synthesizeMouseAtCenter("#second", {}, popupBrowser);
let newPrivTab = yield newTabPromise;

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

@ -0,0 +1,9 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
BROWSER_CHROME_MANIFESTS += [
'test/browser/browser.ini',
]

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

@ -0,0 +1,11 @@
"use strict";
module.exports = {
"extends": [
"plugin:mozilla/browser-test"
],
"rules": {
"no-undef": "error"
}
};

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

@ -0,0 +1,13 @@
[DEFAULT]
tags = resistfingerprinting
support-files =
file_dummy.html
head.js
[browser_roundedWindow_newWindow.js]
[browser_roundedWindow_open_max.js]
[browser_roundedWindow_open_mid.js]
[browser_roundedWindow_open_min.js]
[browser_roundedWindow_windowSetting_max.js]
[browser_roundedWindow_windowSetting_mid.js]
[browser_roundedWindow_windowSetting_min.js]

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

@ -0,0 +1,49 @@
/*
* Bug 1330882 - A test case for opening new windows as rounded size when
* fingerprinting resistance is enabled.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize();
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_new_window() {
// Open a new window.
let win = yield BrowserTestUtils.openNewBrowserWindow();
// Load a page and verify its window size.
let tab = yield BrowserTestUtils.openNewForegroundTab(
win.gBrowser, TEST_PATH + "file_dummy.html");
yield ContentTask.spawn(tab.linkedBrowser, {gMaxAvailWidth, gMaxAvailHeight},
function* (input) {
is(content.screen.width, input.gMaxAvailWidth,
"The screen.width has a correct rounded value");
is(content.screen.height, input.gMaxAvailHeight,
"The screen.height has a correct rounded value");
is(content.innerWidth, input.gMaxAvailWidth,
"The window.innerWidth has a correct rounded value");
is(content.innerHeight, input.gMaxAvailHeight,
"The window.innerHeight has a correct rounded value");
}
);
yield BrowserTestUtils.removeTab(tab);
yield BrowserTestUtils.closeWindow(win);
});

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

@ -0,0 +1,62 @@
/*
* Bug 1330882 - A test case for opening new windows through window.open() as
* rounded size when fingerprinting resistance is enabled. This test is for
* maximum values.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
// We need the chrome UI size of popup windows for testing outerWidth/Height.
let gPopupChromeUIWidth;
let gPopupChromeUIHeight;
const TESTCASES = [
{ settingWidth: 1025, settingHeight: 1050, targetWidth: 1000, targetHeight: 1000 },
{ settingWidth: 9999, settingHeight: 9999, targetWidth: 1000, targetHeight: 1000 },
{ settingWidth: 999, settingHeight: 999, targetWidth: 1000, targetHeight: 1000 },
];
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
let popUpChromeUISize = yield calcPopUpWindowChromeUISize();
gPopupChromeUIWidth = popUpChromeUISize.chromeWidth;
gPopupChromeUIHeight = popUpChromeUISize.chromeHeight;
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize(gPopupChromeUIWidth,
gPopupChromeUIHeight);
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_window_open() {
// Open a tab to test window.open().
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, TEST_PATH + "file_dummy.html");
for (let test of TESTCASES) {
// Test 'width' and 'height' of window features.
yield testWindowOpen(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, false, gMaxAvailWidth,
gMaxAvailHeight, gPopupChromeUIWidth, gPopupChromeUIHeight);
// test 'outerWidth' and 'outerHeight' of window features.
yield testWindowOpen(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, true, gMaxAvailWidth,
gMaxAvailHeight, gPopupChromeUIWidth, gPopupChromeUIHeight);
}
yield BrowserTestUtils.removeTab(tab);
});

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

@ -0,0 +1,62 @@
/*
* Bug 1330882 - A test case for opening new windows through window.open() as
* rounded size when fingerprinting resistance is enabled. This test is for
* middle values.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
// We need the chrome UI size of popup windows for testing outerWidth/Height.
let gPopupChromeUIWidth;
let gPopupChromeUIHeight;
const TESTCASES = [
{ settingWidth: 600, settingHeight: 600, targetWidth: 600, targetHeight: 600 },
{ settingWidth: 599, settingHeight: 599, targetWidth: 600, targetHeight: 600 },
{ settingWidth: 401, settingHeight: 501, targetWidth: 600, targetHeight: 600 },
];
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
let popUpChromeUISize = yield calcPopUpWindowChromeUISize();
gPopupChromeUIWidth = popUpChromeUISize.chromeWidth;
gPopupChromeUIHeight = popUpChromeUISize.chromeHeight;
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize(gPopupChromeUIWidth,
gPopupChromeUIHeight);
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_window_open() {
// Open a tab to test window.open().
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, TEST_PATH + "file_dummy.html");
for (let test of TESTCASES) {
// Test 'width' and 'height' of window features.
yield testWindowOpen(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, false, gMaxAvailWidth,
gMaxAvailHeight, gPopupChromeUIWidth, gPopupChromeUIHeight);
// test 'outerWidth' and 'outerHeight' of window features.
yield testWindowOpen(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, true, gMaxAvailWidth,
gMaxAvailHeight, gPopupChromeUIWidth, gPopupChromeUIHeight);
}
yield BrowserTestUtils.removeTab(tab);
});

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

@ -0,0 +1,61 @@
/*
* Bug 1330882 - A test case for opening new windows through window.open() as
* rounded size when fingerprinting resistance is enabled. This test is for
* minimum values.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
// We need the chrome UI size of popup windows for testing outerWidth/Height.
let gPopupChromeUIWidth;
let gPopupChromeUIHeight;
const TESTCASES = [
{ settingWidth: 199, settingHeight: 99, targetWidth: 200, targetHeight: 100 },
{ settingWidth: 10, settingHeight: 10, targetWidth: 200, targetHeight: 100 },
];
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
let popUpChromeUISize = yield calcPopUpWindowChromeUISize();
gPopupChromeUIWidth = popUpChromeUISize.chromeWidth;
gPopupChromeUIHeight = popUpChromeUISize.chromeHeight;
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize(gPopupChromeUIWidth,
gPopupChromeUIHeight);
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_window_open() {
// Open a tab to test window.open().
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, TEST_PATH + "file_dummy.html");
for (let test of TESTCASES) {
// Test 'width' and 'height' of window features.
yield testWindowOpen(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, false, gMaxAvailWidth,
gMaxAvailHeight, gPopupChromeUIWidth, gPopupChromeUIHeight);
// test 'outerWidth' and 'outerHeight' of window features.
yield testWindowOpen(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, true, gMaxAvailWidth,
gMaxAvailHeight, gPopupChromeUIWidth, gPopupChromeUIHeight);
}
yield BrowserTestUtils.removeTab(tab);
});

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

@ -0,0 +1,67 @@
/*
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
* and window.outerWidth/Height when fingerprinting resistance is enabled. This
* test is for maximum values.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
// We need the chrome UI size of popup windows for testing outerWidth/Height.
let gPopupChromeUIWidth;
let gPopupChromeUIHeight;
const TESTCASES = [
{ settingWidth: 1025, settingHeight: 1050, targetWidth: 1000, targetHeight: 1000,
initWidth: 200, initHeight: 100 },
{ settingWidth: 9999, settingHeight: 9999, targetWidth: 1000, targetHeight: 1000,
initWidth: 200, initHeight: 100 },
{ settingWidth: 999, settingHeight: 999, targetWidth: 1000, targetHeight: 1000,
initWidth: 200, initHeight: 100 },
];
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
let popUpChromeUISize = yield calcPopUpWindowChromeUISize();
gPopupChromeUIWidth = popUpChromeUISize.chromeWidth;
gPopupChromeUIHeight = popUpChromeUISize.chromeHeight;
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize(gPopupChromeUIWidth,
gPopupChromeUIHeight);
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_window_size_setting() {
// Open a tab to test.
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, TEST_PATH + "file_dummy.html");
for (let test of TESTCASES) {
// Test window.innerWidth and window.innerHeight.
yield testWindowSizeSetting(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, test.initWidth,
test.initHeight, false, gMaxAvailWidth, gMaxAvailHeight,
gPopupChromeUIWidth, gPopupChromeUIHeight);
// test window.outerWidth and window.outerHeight.
yield testWindowSizeSetting(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, test.initWidth,
test.initHeight, true, gMaxAvailWidth, gMaxAvailHeight,
gPopupChromeUIWidth, gPopupChromeUIHeight);
}
yield BrowserTestUtils.removeTab(tab);
});

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

@ -0,0 +1,67 @@
/*
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
* and window.outerWidth/Height when fingerprinting resistance is enabled. This
* test is for middle values.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
// We need the chrome UI size of popup windows for testing outerWidth/Height.
let gPopupChromeUIWidth;
let gPopupChromeUIHeight;
const TESTCASES = [
{ settingWidth: 600, settingHeight: 600, targetWidth: 600, targetHeight: 600,
initWidth: 200, initHeight: 100 },
{ settingWidth: 599, settingHeight: 599, targetWidth: 600, targetHeight: 600,
initWidth: 200, initHeight: 100 },
{ settingWidth: 401, settingHeight: 501, targetWidth: 600, targetHeight: 600,
initWidth: 200, initHeight: 100 },
];
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
let popUpChromeUISize = yield calcPopUpWindowChromeUISize();
gPopupChromeUIWidth = popUpChromeUISize.chromeWidth;
gPopupChromeUIHeight = popUpChromeUISize.chromeHeight;
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize(gPopupChromeUIWidth,
gPopupChromeUIHeight);
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_window_size_setting() {
// Open a tab to test.
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, TEST_PATH + "file_dummy.html");
for (let test of TESTCASES) {
// Test window.innerWidth and window.innerHeight.
yield testWindowSizeSetting(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, test.initWidth,
test.initHeight, false, gMaxAvailWidth, gMaxAvailHeight,
gPopupChromeUIWidth, gPopupChromeUIHeight);
// test window.outerWidth and window.outerHeight.
yield testWindowSizeSetting(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, test.initWidth,
test.initHeight, true, gMaxAvailWidth, gMaxAvailHeight,
gPopupChromeUIWidth, gPopupChromeUIHeight);
}
yield BrowserTestUtils.removeTab(tab);
});

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

@ -0,0 +1,65 @@
/*
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
* and window.outerWidth/Height when fingerprinting resistance is enabled. This
* test is for minimum values.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_DOMAIN = "http://example.net/";
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
let gMaxAvailWidth;
let gMaxAvailHeight;
// We need the chrome UI size of popup windows for testing outerWidth/Height.
let gPopupChromeUIWidth;
let gPopupChromeUIHeight;
const TESTCASES = [
{ settingWidth: 199, settingHeight: 99, targetWidth: 200, targetHeight: 100,
initWidth: 1000, initHeight: 1000 },
{ settingWidth: 10, settingHeight: 10, targetWidth: 200, targetHeight: 100,
initWidth: 1000, initHeight: 1000 },
];
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({"set":
[["privacy.resistFingerprinting", true]]
});
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
let popUpChromeUISize = yield calcPopUpWindowChromeUISize();
gPopupChromeUIWidth = popUpChromeUISize.chromeWidth;
gPopupChromeUIHeight = popUpChromeUISize.chromeHeight;
// Calculate the maximum available size.
let maxAvailSize = yield calcMaximumAvailSize(gPopupChromeUIWidth,
gPopupChromeUIHeight);
gMaxAvailWidth = maxAvailSize.maxAvailWidth;
gMaxAvailHeight = maxAvailSize.maxAvailHeight;
});
add_task(function* test_window_size_setting() {
// Open a tab to test.
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, TEST_PATH + "file_dummy.html");
for (let test of TESTCASES) {
// Test window.innerWidth and window.innerHeight.
yield testWindowSizeSetting(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, test.initWidth,
test.initHeight, false, gMaxAvailWidth, gMaxAvailHeight,
gPopupChromeUIWidth, gPopupChromeUIHeight);
// test window.outerWidth and window.outerHeight.
yield testWindowSizeSetting(tab.linkedBrowser, test.settingWidth, test.settingHeight,
test.targetWidth, test.targetHeight, test.initWidth,
test.initHeight, true, gMaxAvailWidth, gMaxAvailHeight,
gPopupChromeUIWidth, gPopupChromeUIHeight);
}
yield BrowserTestUtils.removeTab(tab);
});

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

@ -0,0 +1,9 @@
<html>
<head>
<title>Dummy test page</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"></meta>
</head>
<body>
<p>Dummy test page</p>
</body>
</html>

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

@ -0,0 +1,227 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// This function calculates the maximum available window dimensions and returns
// them as an object.
function* calcMaximumAvailSize(aChromeWidth, aChromeHeight) {
let chromeUIWidth;
let chromeUIHeight;
let testPath = "http://example.net/browser/browser/" +
"components/resistFingerprinting/test/browser/"
// If the chrome UI dimensions is not given, we will calculate it.
if (!aChromeWidth || !aChromeHeight) {
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, testPath + "file_dummy.html");
let contentSize = yield ContentTask.spawn(tab.linkedBrowser, null, function* () {
let result = {
width: content.innerWidth,
height: content.innerHeight
};
return result;
});
// Calculate the maximum available window size which is depending on the
// available screen space.
chromeUIWidth = window.outerWidth - contentSize.width;
chromeUIHeight = window.outerHeight - contentSize.height;
yield BrowserTestUtils.removeTab(tab);
} else {
chromeUIWidth = aChromeWidth;
chromeUIHeight = aChromeHeight;
}
let availWidth = window.screen.availWidth;
let availHeight = window.screen.availHeight;
// Ideally, we would round the window size as 1000x1000. But the available
// screen space might not suffice. So, we decide the size according to the
// available screen size.
let availContentWidth = Math.min(1000, availWidth - chromeUIWidth);
let availContentHeight;
// If it is GTK window, we would consider the system decorations when we
// calculating avail content height since the system decorations won't be
// reported when we get available screen dimensions.
if (AppConstants.MOZ_WIDGET_GTK) {
availContentHeight = Math.min(1000, -40 + availHeight - chromeUIHeight);
} else {
availContentHeight = Math.min(1000, availHeight - chromeUIHeight);
}
// Rounded the desire size to the nearest 200x100.
let maxAvailWidth = availContentWidth - (availContentWidth % 200);
let maxAvailHeight = availContentHeight - (availContentHeight % 100);
return {maxAvailWidth, maxAvailHeight};
}
function* calcPopUpWindowChromeUISize() {
let testPath = "http://example.net/browser/browser/" +
"components/resistFingerprinting/test/browser/"
// open a popup window to acquire the chrome UI size of it.
let tab = yield BrowserTestUtils.openNewForegroundTab(
gBrowser, testPath + "file_dummy.html");
let result = yield ContentTask.spawn(tab.linkedBrowser, null, function* () {
let win;
yield new Promise(resolve => {
win = content.open("about:blank", "", "width=1000,height=1000");
win.onload = () => resolve();
});
let res = {
chromeWidth: win.outerWidth - win.innerWidth,
chromeHeight: win.outerHeight - win.innerHeight
};
win.close();
return res;
});
yield BrowserTestUtils.removeTab(tab);
return result;
}
function* testWindowOpen(aBrowser, aSettingWidth, aSettingHeight,
aTargetWidth, aTargetHeight, aTestOuter,
aMaxAvailWidth, aMaxAvailHeight, aPopupChromeUIWidth,
aPopupChromeUIHeight) {
// If the target size is greater than the maximum available content size,
// we set the target size to it.
if (aTargetWidth > aMaxAvailWidth) {
aTargetWidth = aMaxAvailWidth;
}
if (aTargetHeight > aMaxAvailHeight) {
aTargetHeight = aMaxAvailHeight;
}
// Create the testing window features.
let winFeatures;
if (aTestOuter) {
winFeatures = "outerWidth=" + (aSettingWidth + aPopupChromeUIWidth) +
",outerHeight=" + (aSettingHeight + aPopupChromeUIHeight);
} else {
winFeatures = "width=" + aSettingWidth + ",height=" + aSettingHeight;
}
let testParams = {
winFeatures,
targetWidth: aTargetWidth,
targetHeight: aTargetHeight,
};
yield ContentTask.spawn(aBrowser, testParams,
function* (input) {
// Call window.open() with window features.
yield new Promise(resolve => {
let win = content.open("http://example.net/", "", input.winFeatures);
win.onload = () => {
is(win.screen.width, input.targetWidth,
"The screen.width has a correct rounded value");
is(win.screen.height, input.targetHeight,
"The screen.height has a correct rounded value");
is(win.innerWidth, input.targetWidth,
"The window.innerWidth has a correct rounded value");
is(win.innerHeight, input.targetHeight,
"The window.innerHeight has a correct rounded value");
win.close()
resolve();
};
});
}
);
}
function* testWindowSizeSetting(aBrowser, aSettingWidth, aSettingHeight,
aTargetWidth, aTargetHeight, aInitWidth,
aInitHeight, aTestOuter, aMaxAvailWidth,
aMaxAvailHeight, aPopupChromeUIWidth,
aPopupChromeUIHeight) {
// If the target size is greater than the maximum available content size,
// we set the target size to it.
if (aTargetWidth > aMaxAvailWidth) {
aTargetWidth = aMaxAvailWidth;
}
if (aTargetHeight > aMaxAvailHeight) {
aTargetHeight = aMaxAvailHeight;
}
let testParams = {
initWidth: aInitWidth,
initHeight: aInitHeight,
settingWidth: aSettingWidth + (aTestOuter ? aPopupChromeUIWidth : 0),
settingHeight: aSettingHeight + (aTestOuter ? aPopupChromeUIHeight : 0),
targetWidth: aTargetWidth,
targetHeight: aTargetHeight,
testOuter: aTestOuter
};
yield ContentTask.spawn(aBrowser, testParams,
function* (input) {
let win;
// Open a new window and wait until it loads.
yield new Promise(resolve => {
// Given a initial window size which should be different from target
// size. We need this to trigger 'onresize' event.
let initWinFeatures = "width=" + input.initWidth + ",height=" + input.initHeight;
win = content.open("http://example.net/", "", initWinFeatures);
win.onload = () => resolve();
});
// Test inner/outerWidth.
yield new Promise(resolve => {
win.onresize = () => {
is(win.screen.width, input.targetWidth,
"The screen.width has a correct rounded value");
is(win.innerWidth, input.targetWidth,
"The window.innerWidth has a correct rounded value");
resolve();
};
if (input.testOuter) {
win.outerWidth = input.settingWidth;
} else {
win.innerWidth = input.settingWidth;
}
});
// Test inner/outerHeight.
yield new Promise(resolve => {
win.onresize = () => {
is(win.screen.height, input.targetHeight,
"The screen.height has a correct rounded value");
is(win.innerHeight, input.targetHeight,
"The window.innerHeight has a correct rounded value");
resolve();
};
if (input.testOuter) {
win.outerHeight = input.settingHeight;
} else {
win.innerHeight = input.settingHeight;
}
});
win.close();
}
);
}

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

@ -221,6 +221,14 @@ function debug(aMsg) {
}
}
/**
* A global value to tell that fingerprinting resistance is enabled or not.
* If it's enabled, the session restore won't restore the window's size and
* size mode.
* This value is controlled by preference privacy.resistFingerprinting.
*/
var gResistFingerprintingEnabled = false;
this.SessionStore = {
get promiseInitialized() {
return SessionStoreInternal.promiseInitialized;
@ -701,6 +709,10 @@ var SessionStoreInternal = {
this._max_windows_undo = this._prefBranch.getIntPref("sessionstore.max_windows_undo");
this._prefBranch.addObserver("sessionstore.max_windows_undo", this, true);
gResistFingerprintingEnabled = Services.prefs.getBoolPref("privacy.resistFingerprinting");
Services.prefs.addObserver("privacy.resistFingerprinting", this, false);
},
/**
@ -1822,6 +1834,9 @@ var SessionStoreInternal = {
this._max_windows_undo = this._prefBranch.getIntPref("sessionstore.max_windows_undo");
this._capClosedWindows();
break;
case "privacy.resistFingerprinting":
gResistFingerprintingEnabled = Services.prefs.getBoolPref("privacy.resistFingerprinting");
break;
}
},
@ -3888,14 +3903,14 @@ var SessionStoreInternal = {
if (!isNaN(aLeft) && !isNaN(aTop) && (aLeft != win_("screenX") || aTop != win_("screenY"))) {
aWindow.moveTo(aLeft, aTop);
}
if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height"))) {
if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height")) && !gResistFingerprintingEnabled) {
// Don't resize the window if it's currently maximized and we would
// maximize it again shortly after.
if (aSizeMode != "maximized" || win_("sizemode") != "maximized") {
aWindow.resizeTo(aWidth, aHeight);
}
}
if (aSizeMode && win_("sizemode") != aSizeMode) {
if (aSizeMode && win_("sizemode") != aSizeMode && !gResistFingerprintingEnabled) {
switch (aSizeMode) {
case "maximized":
aWindow.maximize();

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -24,9 +24,9 @@
"size": 12072532
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -16,9 +16,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 110077036,
"digest": "8b99d058cc081f6ca2a3cc88c3ca9c15232961d2539774dacee35e2258955ad8fc4cb0af3b903a3e3f8a264ddecb3baae9256502ffc178a2823779284ace2bd8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 112075416,
"digest": "134538dda3512363c8b103fc59128aba830bd994053612f8ad8721e1a0033ad9836cd11595ed8056d885aec7dc78b7f4c4169c0a12bd0f9c31549f2d81939054",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -8,9 +8,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 122706608,
"digest": "b9ae830cfe24430907490cd58f8215447667fb8f1f052d6e78c8ecd7aadfbc92f75a404774d4cc7b30a46b756275209c2fe2723473704b3bce7ffee908e353a8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 124444249,
"digest": "11239565e6dde851a5229a0380da129b129c560c3fa765eb4998549e688385be314523074456afec9ebe4ddb6af71e44c64d7c669e7e904ed253f6e7b0f6317b",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true

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

@ -42,9 +42,9 @@
"filename": "dmg.tar.xz"
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 140284816,
"digest": "c97503ed2448af059a450792aac76f9b91ce8bc6daf683cdbc2d3fb49a6bd205a4ba854838281b1e3888ae15b5df585cc8fa56365fb1ec5acafc9e1b8871f3e3",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 142669732,
"digest": "ab74516718ac2b848f0d28df314c0588559dd77b203e8e0a20510a44e7d8b9b757b35c5eebd72524d9ce29bfa10a6e72e44fa54cb9cfe808bb42b5fc603b14bc",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -8,9 +8,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 122706608,
"digest": "b9ae830cfe24430907490cd58f8215447667fb8f1f052d6e78c8ecd7aadfbc92f75a404774d4cc7b30a46b756275209c2fe2723473704b3bce7ffee908e353a8",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 124444249,
"digest": "11239565e6dde851a5229a0380da129b129c560c3fa765eb4998549e688385be314523074456afec9ebe4ddb6af71e44c64d7c669e7e904ed253f6e7b0f6317b",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true

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

@ -6,9 +6,9 @@
"filename": "mozmake.exe"
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 67227255,
"digest": "95164dc1abb2ab90ea18cf4f322d5c8390e0212e79a52b12578720d568eb6df62e55a9938c8d2a364cd3a6bd0f99608c2139d141a88ec43484b8d0651398532a",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 68287611,
"digest": "702b162f53970de096d1c7777f37eddd22251a910d523df4edcbead399d40bfb85b059b5745ec8d6e835149a8c7e7888aed36f7ca77ddfd57466a72505c2e86f",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true

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

@ -6,9 +6,9 @@
"filename": "mozmake.exe"
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 67227255,
"digest": "95164dc1abb2ab90ea18cf4f322d5c8390e0212e79a52b12578720d568eb6df62e55a9938c8d2a364cd3a6bd0f99608c2139d141a88ec43484b8d0651398532a",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 68287611,
"digest": "702b162f53970de096d1c7777f37eddd22251a910d523df4edcbead399d40bfb85b059b5745ec8d6e835149a8c7e7888aed36f7ca77ddfd57466a72505c2e86f",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true

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

@ -6,9 +6,9 @@
"filename": "mozmake.exe"
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 67227255,
"digest": "95164dc1abb2ab90ea18cf4f322d5c8390e0212e79a52b12578720d568eb6df62e55a9938c8d2a364cd3a6bd0f99608c2139d141a88ec43484b8d0651398532a",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 68287611,
"digest": "702b162f53970de096d1c7777f37eddd22251a910d523df4edcbead399d40bfb85b059b5745ec8d6e835149a8c7e7888aed36f7ca77ddfd57466a72505c2e86f",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true

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

@ -6,9 +6,9 @@
"filename": "mozmake.exe"
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 72782416,
"digest": "bf9fb1a21de834d7b6992fe9d95dfe2ff19e3cbff5b00117889eef0e6c9d85442cd75640e3051f0c1788b1f629e79ffae5cc8a4106b0cad520c1f954ae2be6b0",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 73762095,
"digest": "9241134ee89a0beca228d9867b7526621faf05560fe802bb6471cc19d5c42135933883e1abd934c8d6657a06c975e167a3712e80e01bf9aa443db6ebb03a8096",
"algorithm": "sha512",
"visibility": "public",
"filename": "rustc.tar.bz2",

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

@ -6,9 +6,9 @@
"filename": "mozmake.exe"
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 72782416,
"digest": "bf9fb1a21de834d7b6992fe9d95dfe2ff19e3cbff5b00117889eef0e6c9d85442cd75640e3051f0c1788b1f629e79ffae5cc8a4106b0cad520c1f954ae2be6b0",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 73762095,
"digest": "9241134ee89a0beca228d9867b7526621faf05560fe802bb6471cc19d5c42135933883e1abd934c8d6657a06c975e167a3712e80e01bf9aa443db6ebb03a8096",
"algorithm": "sha512",
"visibility": "public",
"filename": "rustc.tar.bz2",

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

@ -883,7 +883,7 @@ return /******/ (function(modules) { // webpackBootstrap
displayName: "Number",
propTypes: {
object: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.number]).isRequired
object: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.number, React.PropTypes.bool]).isRequired
},
stringify: function (object) {
@ -973,9 +973,8 @@ return /******/ (function(modules) { // webpackBootstrap
}
if (array.length > max) {
let objectLink = this.props.objectLink || DOM.span;
items.push(Caption({
object: objectLink({
object: this.safeObjectLink({
object: this.props.object
}, array.length - max + " more…")
}));
@ -1028,6 +1027,20 @@ return /******/ (function(modules) { // webpackBootstrap
onClickBracket: function (event) {},
safeObjectLink: function (config, ...children) {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({
object: this.props.object
}, config), ...children);
}
if (Object.keys(config).length === 0 && children.length === 1) {
return children[0];
}
return DOM.span(config, ...children);
},
render: wrapRender(function () {
let {
object,
@ -1050,13 +1063,11 @@ return /******/ (function(modules) { // webpackBootstrap
brackets = needSpace(items.length > 0);
}
let objectLink = this.props.objectLink || DOM.span;
return DOM.span({
className: "objectBox objectBox-array" }, objectLink({
className: "objectBox objectBox-array" }, this.safeObjectLink({
className: "arrayLeftBracket",
object: object
}, brackets.left), ...items, objectLink({
}, brackets.left), ...items, this.safeObjectLink({
className: "arrayRightBracket",
object: object
}, brackets.right), DOM.span({
@ -1115,7 +1126,7 @@ return /******/ (function(modules) { // webpackBootstrap
displayName: "Caption",
propTypes: {
object: React.PropTypes.object
object: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]).isRequired
},
render: wrapRender(function () {
@ -1157,12 +1168,7 @@ return /******/ (function(modules) { // webpackBootstrap
getTitle: function (object) {
let title = this.props.title || object.class || "Object";
if (this.props.objectLink) {
return this.props.objectLink({
object: object
}, title);
}
return title;
return this.safeObjectLink({ className: "objectTitle" }, title);
},
safePropIterator: function (object, max) {
@ -1258,21 +1264,32 @@ return /******/ (function(modules) { // webpackBootstrap
return propsArray;
},
safeObjectLink: function (config, ...children) {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({
object: this.props.object
}, config), ...children);
}
if (Object.keys(config).length === 0 && children.length === 1) {
return children[0];
}
return span(config, ...children);
},
render: wrapRender(function () {
let object = this.props.object;
let propsArray = this.safePropIterator(object);
let objectLink = this.props.objectLink || span;
if (this.props.mode === MODE.TINY || !propsArray.length) {
return span({ className: "objectBox objectBox-object" }, objectLink({ className: "objectTitle" }, this.getTitle(object)));
return span({ className: "objectBox objectBox-object" }, this.getTitle(object));
}
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, " { "), ...propsArray, objectLink({
className: "objectRightBrace",
object: object
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), this.safeObjectLink({
className: "objectLeftBrace"
}, " { "), ...propsArray, this.safeObjectLink({
className: "objectRightBrace"
}, " }"));
})
});
@ -1408,12 +1425,7 @@ return /******/ (function(modules) { // webpackBootstrap
getTitle: function (object) {
let title = this.props.title || object.class || "Object";
if (this.props.objectLink) {
return this.props.objectLink({
object: object
}, title);
}
return title;
return this.safeObjectLink({}, title);
},
safePropIterator: function (object, max) {
@ -1467,12 +1479,8 @@ return /******/ (function(modules) { // webpackBootstrap
let propsArray = this.getProps(properties, indexes, truncate, suppressQuotes);
if (truncate) {
// There are some undisplayed props. Then display "more...".
let objectLink = this.props.objectLink || span;
propsArray.push(Caption({
object: objectLink({
object: object
}, `${propertiesLength - max} more…`)
object: this.safeObjectLink({}, `${propertiesLength - max} more…`)
}));
}
@ -1501,7 +1509,7 @@ return /******/ (function(modules) { // webpackBootstrap
let name = Object.keys(properties)[i];
let value = this.getPropValue(properties[name]);
propsArray.push(PropRep(Object.assign({}, this.props, {
let propRepProps = Object.assign({}, this.props, {
mode: MODE.TINY,
name: name,
object: value,
@ -1511,7 +1519,9 @@ return /******/ (function(modules) { // webpackBootstrap
// Do not propagate title to properties reps
title: undefined,
suppressQuotes
})));
});
delete propRepProps.objectLink;
propsArray.push(PropRep(propRepProps));
});
return propsArray;
@ -1571,24 +1581,32 @@ return /******/ (function(modules) { // webpackBootstrap
return value;
},
safeObjectLink: function (config, ...children) {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({
object: this.props.object
}, config), ...children);
}
if (Object.keys(config).length === 0 && children.length === 1) {
return children[0];
}
return span(config, ...children);
},
render: wrapRender(function () {
let object = this.props.object;
let propsArray = this.safePropIterator(object, this.props.mode === MODE.LONG ? 10 : 3);
let objectLink = this.props.objectLink || span;
if (this.props.mode === MODE.TINY) {
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, ""));
return span({ className: "objectBox objectBox-object" }, this.getTitle(object));
}
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, " { "), ...propsArray, objectLink({
className: "objectRightBrace",
object: object
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), this.safeObjectLink({
className: "objectLeftBrace"
}, " { "), ...propsArray, this.safeObjectLink({
className: "objectRightBrace"
}, " }"));
})
});
@ -1757,9 +1775,14 @@ return /******/ (function(modules) { // webpackBootstrap
render: wrapRender(function () {
let object = this.props.object;
let value = object.preview.value;
let objectLink = this.props.objectLink || span;
let objectLink = (config, ...children) => {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({ object }, config), ...children);
}
return span(config, ...children);
};
return objectLink({ className: "objectLink-Attr", object }, span({}, span({ className: "attrTitle" }, this.getTitle(object)), span({ className: "attrEqual" }, "="), StringRepFactory({ object: value })));
return objectLink({ className: "objectLink-Attr" }, span({ className: "attrTitle" }, this.getTitle(object)), span({ className: "attrEqual" }, "="), StringRepFactory({ object: value }));
})
});
@ -2136,12 +2159,7 @@ return /******/ (function(modules) { // webpackBootstrap
getTitle: function (object) {
const title = object.class;
if (this.props.objectLink) {
return this.props.objectLink({
object: object
}, title);
}
return title;
return this.safeObjectLink({}, title);
},
getProps: function (promiseState) {
@ -2163,30 +2181,39 @@ return /******/ (function(modules) { // webpackBootstrap
});
},
safeObjectLink: function (config, ...children) {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({
object: this.props.object
}, config), ...children);
}
if (Object.keys(config).length === 0 && children.length === 1) {
return children[0];
}
return span(config, ...children);
},
render: wrapRender(function () {
const object = this.props.object;
const { promiseState } = object;
let objectLink = this.props.objectLink || span;
if (this.props.mode === MODE.TINY) {
let { Rep } = createFactories(__webpack_require__(2));
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, " { "), Rep({ object: promiseState.state }), objectLink({
className: "objectRightBrace",
object: object
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), this.safeObjectLink({
className: "objectLeftBrace"
}, " { "), Rep({ object: promiseState.state }), this.safeObjectLink({
className: "objectRightBrace"
}, " }"));
}
const propsArray = this.getProps(promiseState);
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, " { "), ...propsArray, objectLink({
className: "objectRightBrace",
object: object
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), this.safeObjectLink({
className: "objectLeftBrace"
}, " { "), ...propsArray, this.safeObjectLink({
className: "objectRightBrace"
}, " }"));
})
});
@ -2237,13 +2264,17 @@ return /******/ (function(modules) { // webpackBootstrap
},
render: wrapRender(function () {
let grip = this.props.object;
let objectLink = this.props.objectLink || span;
let { object } = this.props;
let objectLink = (config, ...children) => {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({ object }, config), ...children);
}
return span(config, ...children);
};
return span({ className: "objectBox objectBox-regexp" }, objectLink({
object: grip,
className: "regexpSource"
}, this.getSource(grip)));
return objectLink({
className: "objectBox objectBox-regexp regexpSource"
}, this.getSource(object));
})
});
@ -2475,7 +2506,12 @@ return /******/ (function(modules) { // webpackBootstrap
onInspectIconClick
} = this.props;
let elements = this.getElements(object, mode);
let objectLink = this.props.objectLink || span;
let objectLink = (config, ...children) => {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({ object }, config), ...children);
}
return span(config, ...children);
};
let isInTree = attachedActorIds ? attachedActorIds.includes(object.actor) : true;
@ -2505,7 +2541,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
return span(baseConfig, objectLink({ object }, ...elements), inspectIcon);
return span(baseConfig, objectLink({}, ...elements), inspectIcon);
})
});
@ -2864,8 +2900,14 @@ return /******/ (function(modules) { // webpackBootstrap
content = `${content}\nStack trace:\n${preview.stack}`;
}
let objectLink = this.props.objectLink || span;
return objectLink({ object, className: "objectBox-stackTrace" }, span({}, content));
let objectLink = (config, ...children) => {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({ object }, config), ...children);
}
return span(config, ...children);
};
return objectLink({ className: "objectBox-stackTrace" }, content);
})
});
@ -3137,14 +3179,12 @@ return /******/ (function(modules) { // webpackBootstrap
},
getTitle: function (object, context) {
let objectLink = this.props.objectLink || span;
if (this.props.mode !== MODE.TINY) {
let title = this.props.title || object.class || "Array";
return objectLink({
object: object
}, title, " ");
if (this.props.mode === MODE.TINY) {
return "";
}
return "";
let title = this.props.title || object.class || "Array";
return this.safeObjectLink({}, title + " ");
},
getPreviewItems: function (grip) {
@ -3197,18 +3237,29 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
if (previewItems.length > max || gripLength > previewItems.length) {
let objectLink = this.props.objectLink || span;
let leftItemNum = gripLength - max > 0 ? gripLength - max : gripLength - previewItems.length;
items.push(Caption({
object: objectLink({
object: this.props.object
}, leftItemNum + " more…")
object: this.safeObjectLink({}, leftItemNum + " more…")
}));
}
return items;
},
safeObjectLink: function (config, ...children) {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({
object: this.props.object
}, config), ...children);
}
if (Object.keys(config).length === 0 && children.length === 1) {
return children[0];
}
return span(config, ...children);
},
render: wrapRender(function () {
let {
object,
@ -3232,16 +3283,13 @@ return /******/ (function(modules) { // webpackBootstrap
brackets = needSpace(items.length > 0);
}
let objectLink = this.props.objectLink || span;
let title = this.getTitle(object);
return span({
className: "objectBox objectBox-array" }, title, objectLink({
className: "arrayLeftBracket",
object: object
}, brackets.left), ...items, objectLink({
className: "arrayRightBracket",
object: object
className: "objectBox objectBox-array" }, title, this.safeObjectLink({
className: "arrayLeftBracket"
}, brackets.left), ...items, this.safeObjectLink({
className: "arrayRightBracket"
}, brackets.right), span({
className: "arrayProperties",
role: "group" }));
@ -3257,7 +3305,7 @@ return /******/ (function(modules) { // webpackBootstrap
propTypes: {
delim: React.PropTypes.string,
object: React.PropTypes.object.isRequired,
object: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.number, React.PropTypes.string]).isRequired,
objectLink: React.PropTypes.func,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
@ -3328,12 +3376,7 @@ return /******/ (function(modules) { // webpackBootstrap
getTitle: function (object) {
let title = this.props.title || (object && object.class ? object.class : "Map");
if (this.props.objectLink) {
return this.props.objectLink({
object: object
}, title);
}
return title;
return this.safeObjectLink({}, title);
},
safeEntriesIterator: function (object, max) {
@ -3365,13 +3408,9 @@ return /******/ (function(modules) { // webpackBootstrap
let entries = this.getEntries(mapEntries, indexes);
if (entries.length < mapEntries.length) {
// There are some undisplayed entries. Then display "more…".
let objectLink = this.props.objectLink || span;
entries.push(Caption({
key: "more",
object: objectLink({
object: object
}, `${mapEntries.length - max} more…`)
object: this.safeObjectLink({}, `${mapEntries.length - max} more…`)
}));
}
@ -3446,24 +3485,32 @@ return /******/ (function(modules) { // webpackBootstrap
}, []);
},
safeObjectLink: function (config, ...children) {
if (this.props.objectLink) {
return this.props.objectLink(Object.assign({
object: this.props.object
}, config), ...children);
}
if (Object.keys(config).length === 0 && children.length === 1) {
return children[0];
}
return span(config, ...children);
},
render: wrapRender(function () {
let object = this.props.object;
let propsArray = this.safeEntriesIterator(object, this.props.mode === MODE.LONG ? 10 : 3);
let objectLink = this.props.objectLink || span;
if (this.props.mode === MODE.TINY) {
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, ""));
return span({ className: "objectBox objectBox-object" }, this.getTitle(object));
}
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), objectLink({
className: "objectLeftBrace",
object: object
}, " { "), propsArray, objectLink({
className: "objectRightBrace",
object: object
return span({ className: "objectBox objectBox-object" }, this.getTitle(object), this.safeObjectLink({
className: "objectLeftBrace"
}, " { "), propsArray, this.safeObjectLink({
className: "objectRightBrace"
}, " }"));
})
});

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

@ -14,8 +14,8 @@ Test ArrayRep rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
/* import-globals-from head.js */
@ -42,6 +42,7 @@ window.onload = Task.async(function* () {
yield testNested();
yield testArray();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -248,6 +249,42 @@ window.onload = Task.async(function* () {
testRepRenderModes(modeTests, "testNested", componentUnderTest, stub);
}
function testObjectLink() {
let stub = ["a", "b", "c"];
const defaultOutput = `*[ *"a", "b", "c"* ]*`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: `*[*3*]*`,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
stub,
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
});
</script>
</pre>

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

@ -14,14 +14,43 @@ Test Attribute rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, Attribute } = REPS;
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, Attribute } = REPS;
let gripStub = {
try {
testBasic();
testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
SimpleTest.finish();
}
function testBasic() {
// Test that correct rep is chosen
const renderedRep = shallowRenderComponent(Rep, { object: getStub() });
is(renderedRep.type, Attribute.rep, `Rep correctly selects ${Attribute.rep.displayName}`);
// Test rendering
const renderedComponent = renderComponent(Attribute.rep, { object: getStub() });
is(renderedComponent.textContent, "class=\"autocomplete-suggestions\"", "Attribute rep has expected text content");
}
function testObjectLink() {
const renderedComponent = renderComponent(Attribute.rep, {
object: getStub(),
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(renderedComponent.textContent, "*class=\"autocomplete-suggestions\"*",
"Attribute rep has expected text content when an objectLink is passed as a prop");
}
function getStub() {
return {
"type": "object",
"class": "Attr",
"actor": "server1.conn19.obj65",
@ -36,18 +65,6 @@ window.onload = Task.async(function* () {
"value": "autocomplete-suggestions"
}
};
// Test that correct rep is chosen
const renderedRep = shallowRenderComponent(Rep, { object: gripStub });
is(renderedRep.type, Attribute.rep, `Rep correctly selects ${Attribute.rep.displayName}`);
// Test rendering
const renderedComponent = renderComponent(Attribute.rep, { object: gripStub });
is(renderedComponent.textContent, "class=\"autocomplete-suggestions\"", "Attribute rep has expected text content");
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
SimpleTest.finish();
}
});
</script>

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

@ -14,8 +14,8 @@ Test comment-node rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {

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

@ -14,8 +14,8 @@ Test DateTime rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, DateTime } = REPS;
@ -23,6 +23,7 @@ window.onload = Task.async(function* () {
try {
testValid();
testInvalid();
testObjectLink();
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -72,6 +73,30 @@ window.onload = Task.async(function* () {
const renderedComponent = renderComponent(DateTime.rep, { object: gripStub });
is(renderedComponent.textContent, "Invalid Date", "DateTime rep has expected text content for invalid date");
}
function testObjectLink() {
let gripStub = {
"type": "object",
"class": "Date",
"actor": "server1.conn0.child1/obj32",
"extensible": true,
"frozen": false,
"sealed": false,
"ownPropertyLength": 0,
"preview": {
"timestamp": 1459372644859
}
};
// Test rendering
const renderedComponent = renderComponent(DateTime.rep, {
object: gripStub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(renderedComponent.textContent, "*Date *2016-03-30T21:17:24.859Z",
"DateTime rep has expected text content when an objectLink is passed as a prop");
}
});
</script>
</pre>

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

@ -14,14 +14,45 @@ Test Document rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, Document } = REPS;
try {
let gripStub = {
testBasic();
testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
SimpleTest.finish();
}
function testBasic() {
// Test that correct rep is chosen
const renderedRep = shallowRenderComponent(Rep, { object: getStub() });
is(renderedRep.type, Document.rep, `Rep correctly selects ${Document.rep.displayName}`);
// Test rendering
const renderedComponent = renderComponent(Document.rep, { object: getStub() });
is(renderedComponent.textContent, "https://www.mozilla.org/en-US/firefox/new/",
"Document rep has expected text content");
}
function testObjectLink() {
// Test rendering
const renderedComponent = renderComponent(Document.rep, {
object: getStub(),
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(renderedComponent.textContent, "*HTMLDocument *https://www.mozilla.org/en-US/firefox/new/",
"Document rep has expected text content when an objectLink is passed as a prop");
}
function getStub() {
return {
"type": "object",
"class": "HTMLDocument",
"actor": "server1.conn17.obj115",
@ -36,18 +67,6 @@ window.onload = Task.async(function* () {
"location": "https://www.mozilla.org/en-US/firefox/new/"
}
};
// Test that correct rep is chosen
const renderedRep = shallowRenderComponent(Rep, { object: gripStub });
is(renderedRep.type, Document.rep, `Rep correctly selects ${Document.rep.displayName}`);
// Test rendering
const renderedComponent = renderComponent(Document.rep, { object: gripStub });
is(renderedComponent.textContent, "https://www.mozilla.org/en-US/firefox/new/", "Document rep has expected text content");
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
SimpleTest.finish();
}
});
</script>

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

@ -14,8 +14,8 @@ Test Element node rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {
@ -39,6 +39,7 @@ window.onload = Task.async(function* () {
yield testOnMouseOver();
yield testOnMouseOut();
yield testOnInspectIconClick();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -272,6 +273,29 @@ window.onload = Task.async(function* () {
"onInspectIconClick forwarded the original event to the callback");
}
function testObjectLink() {
const stub = getGripStub("testBodyNode");
const renderedComponent = renderComponent(ElementNode.rep, {
object: stub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(renderedComponent.textContent, `*<body id="body-id" class="body-class">*`,
"Element node rep has expected text content for body node when an objectLink is " +
"passed as a prop");
const tinyRenderedComponent = renderComponent(ElementNode.rep, {
object: stub, mode: MODE.TINY,
objectLink: (props, ...children) => React.DOM.span({
className: "object-link"
}, "*", ...children, "*"),
});
is(tinyRenderedComponent.textContent, `*body#body-id.body-class*`,
"Element node rep has expected text content for body node in tiny mode when an " +
"objectLink is passed as a prop");
}
function getGripStub(name) {
switch (name) {
case "testBodyNode":

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

@ -14,8 +14,8 @@ Test Error rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {
@ -36,6 +36,8 @@ window.onload = Task.async(function* () {
yield testSyntaxError();
yield testTypeError();
yield testURIError();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -260,6 +262,34 @@ window.onload = Task.async(function* () {
"Error Rep has expected text content for URIError in tiny mode");
}
function testObjectLink() {
// Test object = `new Error("Error message")`
const stub = getGripStub("testSimpleError");
const renderedComponent = renderComponent(ErrorRep.rep, {
object: stub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(renderedComponent.textContent,
"*Error: Error message\n" +
"Stack trace:\n" +
"@debugger eval code:1:13\n*",
"Error Rep has expected text content when an objectLink is passed as a prop");
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {
object: stub,
mode: MODE.TINY,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(tinyRenderedComponent.textContent,
"*Error*",
"Error Rep has expected text content in tiny mode when an objectLink is passed " +
"as a prop");
}
function getGripStub(name) {
switch (name) {
case "testSimpleError":

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

@ -14,8 +14,8 @@ Test Event rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const {
REPS,
@ -38,6 +38,8 @@ window.onload = Task.async(function* () {
yield testOnDomNodeMouseOver();
yield testOnDomNodeMouseOut();
yield testOnDomNodeInspectIconClick();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -210,6 +212,29 @@ window.onload = Task.async(function* () {
"when the inspect icon is clicked");
}
function testObjectLink() {
const renderedComponent = renderComponent(Event.rep, {
object: getGripStub("testMouseEvent"),
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(renderedComponent.textContent,
"*click** { *target: div#test, clientX: 62, clientY: 18, *3 more…** }*",
"Event rep has expected text content when an objectLink is passed as a prop");
const longRenderedComponent = renderComponent(Event.rep, {
object: getGripStub("testMouseEvent"),
mode: MODE.LONG,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(longRenderedComponent.textContent,
"*click** { *target: div#test, buttons: 0, clientX: 62, clientY: 18, layerX: 0, " +
"layerY: 0* }*",
"Event rep has expected text content in long mode when an objectLink is passed " +
"as a prop");
}
function getGripStub(name) {
switch (name) {
case "testEvent":

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

@ -14,8 +14,8 @@ Test fallback for rep rendering when a rep fails to render.
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");

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

@ -14,8 +14,8 @@ Test Func rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, Func } = REPS;
@ -36,6 +36,7 @@ window.onload = Task.async(function* () {
yield testAnonAsyncFunction();
yield testGeneratorFunction();
yield testAnonGeneratorFunction();
yield testObjectLink();
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -226,6 +227,27 @@ window.onload = Task.async(function* () {
testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
}
function testObjectLink() {
// Test declaration: `function testName() { let innerVar = "foo" }`
const modeTests = [
{
mode: undefined,
expectedOutput: "*function *testName()",
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
getGripStub("testNamed"),
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
function getGripStub(functionName) {
switch (functionName) {
case "testNamed":

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

@ -14,8 +14,8 @@ Test GripArray rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const {
REPS,
@ -46,6 +46,8 @@ window.onload = Task.async(function* () {
yield testOnDomNodeMouseOver();
yield testOnDomNodeMouseOut();
yield testOnDomNodeInspectIconClick();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -414,6 +416,41 @@ window.onload = Task.async(function* () {
});
}
function testObjectLink() {
// Test array = `["test string"…] //4 items`
const defaultOutput = `*Array **[ *${Array(maxLength.short).fill("\"test string\"").join(", ")}, *1 more…** ]*`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: `*[*${maxLength.short + 1}*]*`,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: `*Array **[ *${Array(maxLength.short + 1).fill("\"test string\"").join(", ")}* ]*`,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
getGripStub("testMoreThanShortMaxProps"),
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
function getGripStub(functionName) {
switch (functionName) {
case "testBasic":

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

@ -14,8 +14,8 @@ Test GripMap rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {
@ -41,6 +41,8 @@ window.onload = Task.async(function* () {
yield testOnDomNodeMouseOver();
yield testOnDomNodeMouseOut();
yield testOnDomNodeInspectIconClick();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -400,6 +402,45 @@ window.onload = Task.async(function* () {
});
}
function testObjectLink() {
// Test object:
// `new Map([["key-a",null], ["key-b",undefined], ["key-c","value-c"], ["key-d",4]])`
const defaultOutput =
`*Map** { *"key-a": null, "key-c": "value-c", "key-d": 4, *1 more…** }*`;
const longOutput =
`*Map** { *"key-a": null, "key-b": undefined, "key-c": "value-c", "key-d": 4* }*`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: `*Map*`,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: longOutput,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
getGripStub("testUninterestingEntries"),
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
function getGripStub(functionName) {
switch (functionName) {
case "testEmptyMap":

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

@ -14,8 +14,8 @@ Test grip rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const {
REPS,
@ -52,6 +52,8 @@ window.onload = Task.async(function* () {
yield testOnDomNodeMouseOver();
yield testOnDomNodeMouseOut();
yield testOnDomNodeInspectIconClick();
yield testObjectLink();
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -628,6 +630,42 @@ window.onload = Task.async(function* () {
});
}
function testObjectLink() {
// Test object: `{a: undefined, b: 1, more: 2, d: 3}`;
const defaultOutput = `*Object** { *b: 1, more: 2, d: 3, *1 more…** }*`;
const longOutput = `*Object** { *a: undefined, b: 1, more: 2, d: 3* }*`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: `*Object*`,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: longOutput,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
getGripStub("testMoreProp"),
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
function getGripStub(functionName) {
switch (functionName) {
case "testBasic":

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

@ -14,8 +14,8 @@ Test Infinity rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {

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

@ -14,8 +14,8 @@ Test LongString rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, LongStringRep } = REPS;

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

@ -14,8 +14,8 @@ Test NaN rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {

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

@ -14,8 +14,8 @@ Test Null rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");

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

@ -14,8 +14,8 @@ Test Number rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, Number } = REPS;

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

@ -14,8 +14,8 @@ Test ObjectWithText rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
@ -42,6 +42,17 @@ window.onload = Task.async(function* () {
// Test rendering
const renderedComponent = renderComponent(ObjectWithText.rep, { object: gripStub });
is(renderedComponent.textContent, "\".Shadow\"", "ObjectWithText rep has expected text content");
// Test rendering with objectLink
const objectLinkRenderedComponent = renderComponent(ObjectWithText.rep, {
object: gripStub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(objectLinkRenderedComponent.textContent,
"*CSSStyleRule *\".Shadow\"",
"ObjectWithText rep has expected text content when an objectLink is passed as a prop"
);
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {

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

@ -14,8 +14,8 @@ Test ObjectWithURL rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
@ -48,6 +48,17 @@ window.onload = Task.async(function* () {
const innerNode = renderedComponent.querySelector(".objectPropValue");
is(innerNode.textContent, "https://www.mozilla.org/en-US/", "ObjectWithURL rep has expected inner HTML structure and text content");
// Test rendering with objectLink
const objectLinkRenderedComponent = renderComponent(ObjectWithURL.rep, {
object: gripStub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(objectLinkRenderedComponent.textContent,
"*Location *https://www.mozilla.org/en-US/",
"ObjectWithURL rep has expected text content when an objectLink is passed as a prop"
);
// @TODO test link once Bug 1245303 has been implemented.
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));

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

@ -14,8 +14,8 @@ Test Obj rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, Obj } = REPS;
@ -41,6 +41,9 @@ window.onload = Task.async(function* () {
// Test that you can pass a custom title to the Rep
yield testCustomTitle();
// Test that you can pass an objectLink to the Rep
yield testCustomTitle();
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -285,6 +288,46 @@ window.onload = Task.async(function* () {
}
);
}
function testObjectLink() {
const stub = {
a: undefined,
b: 1,
"more": 2,
d: 3
};
const defaultOutput = `*Object **{ *b: 1, more: 2, d: 3, *1 more…** }*`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: `*Object*`,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
stub,
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
});
</script>
</pre>

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

@ -14,8 +14,8 @@ Test Promise rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {
@ -38,6 +38,8 @@ window.onload = Task.async(function* () {
yield testOnDomNodeMouseOver();
yield testOnDomNodeMouseOut();
yield testOnDomNodeInspectIconClick();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -300,6 +302,44 @@ window.onload = Task.async(function* () {
"when the inspect icon is clicked");
}
function testObjectLink() {
// Test object = `new Promise((resolve, reject) => true)`
const stub = getGripStub("testPending");
// Test rendering
const defaultOutput = `*Promise** { *<state>: "pending"* }*`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: `*Promise** { *"pending"* }*`,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
componentUnderTest,
stub,
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
function getGripStub(name) {
switch (name) {
case "testPending":

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

@ -14,8 +14,8 @@ Test RegExp rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
@ -39,6 +39,18 @@ window.onload = Task.async(function* () {
// Test rendering
const renderedComponent = renderComponent(RegExp.rep, { object: gripStub });
is(renderedComponent.textContent, "/ab+c/i", "RegExp rep has expected text content");
// Test rendering with objectLink
const objectLinkRenderedComponent = renderComponent(RegExp.rep, {
object: gripStub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(
objectLinkRenderedComponent.textContent,
"*/ab+c/i*",
"RegExp rep has expected text content when an objectLink is passed as a prop"
);
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {

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

@ -14,8 +14,8 @@ Test String rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
let { Rep, StringRep } = REPS;

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

@ -14,8 +14,8 @@ Test Stylesheet rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
const { REPS } = browserRequire("devtools/client/shared/components/reps/reps");
@ -42,6 +42,18 @@ window.onload = Task.async(function* () {
// Test rendering
const renderedComponent = renderComponent(StyleSheet.rep, { object: gripStub });
is(renderedComponent.textContent, "StyleSheet https://example.com/styles.css", "StyleSheet rep has expected text content");
// Test rendering with objectLink
const objectLinkRenderedComponent = renderComponent(StyleSheet.rep, {
object: gripStub,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(
objectLinkRenderedComponent.textContent,
"*StyleSheet *https://example.com/styles.css",
"StyleSheet rep has expected text content when an objectLink is passed as a prop"
);
} catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {

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

@ -14,8 +14,8 @@ Test Symbol rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
/* import-globals-from head.js */

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

@ -14,8 +14,8 @@ Test text-node rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = Task.async(function* () {
@ -63,6 +63,8 @@ window.onload = Task.async(function* () {
yield testOnMouseOver();
yield testOnMouseOut();
yield testOnInspectIconClick();
yield testObjectLink();
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
@ -202,6 +204,41 @@ window.onload = Task.async(function* () {
ok(inspectIconClickedEvent !== null && inspectIconClickedEvent.type === "click",
"onInspectIconClick forwarded the original event to the callback");
}
function testObjectLink() {
const stub = gripStubs.get("testRendering");
const defaultOutput = `*#text* "hello world"`;
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: "*#text*",
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(
modeTests,
"testObjectLink",
TextNode,
stub,
{
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
}
);
}
});
</script>
</pre>

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

@ -14,8 +14,8 @@ Test undefined rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");

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

@ -14,8 +14,8 @@ Test window rep
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = Task.async(function* () {
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
@ -77,7 +77,31 @@ window.onload = Task.async(function* () {
});
is(displayClassLongRenderedComponent.textContent, "Custom about:newtab",
"Window rep has expected text content in LONG mode with Custom display class");
} catch(e) {
const objectLinkTinyRenderedComponent = renderComponent(Window.rep, {
object: gripStub,
mode: MODE.TINY,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(
objectLinkTinyRenderedComponent.textContent,
"*Window*",
"Window rep has expected text content in TINY mode when an objectLink is passed as a prop"
);
const objectLinkLongRenderedComponent = renderComponent(Window.rep, {
object: gripStub,
mode: MODE.LONG,
objectLink: (props, ...children) => React.DOM.span({},
"*", ...children, "*"),
});
is(
objectLinkLongRenderedComponent.textContent,
"*Window* about:newtab",
"Window rep has expected text content in LONG mode when an objectLink is passed as a prop"
);
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
SimpleTest.finish();

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -54,236 +54,22 @@ return /******/ (function(modules) { // webpackBootstrap
/* 0 */
/***/ function(module, exports, __webpack_require__) {
let _resolveAndFetch = (() => {
var _ref = _asyncToGenerator(function* (generatedSource) {
// Fetch the sourcemap over the network and create it.
const sourceMapURL = _resolveSourceMapURL(generatedSource);
const fetched = yield networkRequest(sourceMapURL, { loadFromCache: false });
// Create the source map and fix it up.
const map = new SourceMapConsumer(fetched.content);
_setSourceMapRoot(map, sourceMapURL, generatedSource);
return map;
});
return function _resolveAndFetch(_x) {
return _ref.apply(this, arguments);
};
})();
let getOriginalURLs = (() => {
var _ref2 = _asyncToGenerator(function* (generatedSource) {
const map = yield _fetchSourceMap(generatedSource);
return map && map.sources;
});
return function getOriginalURLs(_x2) {
return _ref2.apply(this, arguments);
};
})();
let getGeneratedLocation = (() => {
var _ref3 = _asyncToGenerator(function* (location, originalSource) {
if (!isOriginalId(location.sourceId)) {
return location;
}
const generatedSourceId = originalToGeneratedId(location.sourceId);
const map = yield _getSourceMap(generatedSourceId);
if (!map) {
return location;
}
const { line, column } = map.generatedPositionFor({
source: originalSource.url,
line: location.line,
column: location.column == null ? 0 : location.column,
bias: SourceMapConsumer.LEAST_UPPER_BOUND
});
return {
sourceId: generatedSourceId,
line: line,
// Treat 0 as no column so that line breakpoints work correctly.
column: column === 0 ? undefined : column
};
});
return function getGeneratedLocation(_x3, _x4) {
return _ref3.apply(this, arguments);
};
})();
let getOriginalLocation = (() => {
var _ref4 = _asyncToGenerator(function* (location) {
if (!isGeneratedId(location.sourceId)) {
return location;
}
const map = yield _getSourceMap(location.sourceId);
if (!map) {
return location;
}
const { source: url, line, column } = map.originalPositionFor({
line: location.line,
column: location.column == null ? Infinity : location.column
});
if (url == null) {
// No url means the location didn't map.
return location;
}
return {
sourceId: generatedToOriginalId(location.sourceId, url),
line,
column
};
});
return function getOriginalLocation(_x5) {
return _ref4.apply(this, arguments);
};
})();
let getOriginalSourceText = (() => {
var _ref5 = _asyncToGenerator(function* (originalSource) {
assert(isOriginalId(originalSource.id), "Source is not an original source");
const generatedSourceId = originalToGeneratedId(originalSource.id);
const map = yield _getSourceMap(generatedSourceId);
if (!map) {
return null;
}
let text = map.sourceContentFor(originalSource.url);
if (!text) {
text = (yield networkRequest(originalSource.url, { loadFromCache: false })).content;
}
return {
text,
contentType: getContentType(originalSource.url || "")
};
});
return function getOriginalSourceText(_x6) {
return _ref5.apply(this, arguments);
};
})();
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
/**
* Source Map Worker
* @module utils/source-map-worker
*/
const networkRequest = __webpack_require__(70);
const { parse } = __webpack_require__(71);
const path = __webpack_require__(78);
const { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(79);
const assert = __webpack_require__(90);
const {
originalToGeneratedId,
generatedToOriginalId,
isGeneratedId,
isOriginalId,
getContentType
} = __webpack_require__(65);
let sourceMapRequests = new Map();
let sourceMapsEnabled = false;
function clearSourceMaps() {
sourceMapRequests.clear();
}
function enableSourceMaps() {
sourceMapsEnabled = true;
}
function _resolveSourceMapURL(source) {
const { url = "", sourceMapURL = "" } = source;
if (path.isURL(sourceMapURL) || url == "") {
// If it's already a full URL or the source doesn't have a URL,
// don't resolve anything.
return sourceMapURL;
} else if (path.isAbsolute(sourceMapURL)) {
// If it's an absolute path, it should be resolved relative to the
// host of the source.
const { protocol = "", host = "" } = parse(url);
return `${protocol}//${host}${sourceMapURL}`;
}
// Otherwise, it's a relative path and should be resolved relative
// to the source.
return `${path.dirname(url)}/${sourceMapURL}`;
}
/**
* Sets the source map's sourceRoot to be relative to the source map url.
* @memberof utils/source-map-worker
* @static
*/
function _setSourceMapRoot(sourceMap, absSourceMapURL, source) {
// No need to do this fiddling if we won't be fetching any sources over the
// wire.
if (sourceMap.hasContentsOfAllSources()) {
return;
}
const base = path.dirname(absSourceMapURL.indexOf("data:") === 0 && source.url ? source.url : absSourceMapURL);
if (sourceMap.sourceRoot) {
sourceMap.sourceRoot = path.join(base, sourceMap.sourceRoot);
} else {
sourceMap.sourceRoot = base;
}
return sourceMap;
}
function _getSourceMap(generatedSourceId) {
return sourceMapRequests.get(generatedSourceId);
}
function _fetchSourceMap(generatedSource) {
const existingRequest = sourceMapRequests.get(generatedSource.id);
if (existingRequest) {
// If it has already been requested, return the request. Make sure
// to do this even if sourcemapping is turned off, because
// pretty-printing uses sourcemaps.
//
// An important behavior here is that if it's in the middle of
// requesting it, all subsequent calls will block on the initial
// request.
return existingRequest;
} else if (!generatedSource.sourceMapURL || !sourceMapsEnabled) {
return Promise.resolve(null);
}
// Fire off the request, set it in the cache, and return it.
const req = _resolveAndFetch(generatedSource).catch(e => console.error(e));
sourceMapRequests.set(generatedSource.id, req);
return req;
}
function applySourceMap(generatedId, url, code, mappings) {
const generator = new SourceMapGenerator({ file: url });
mappings.forEach(mapping => generator.addMapping(mapping));
generator.setSourceContent(url, code);
const map = SourceMapConsumer(generator.toJSON());
sourceMapRequests.set(generatedId, Promise.resolve(map));
}
getOriginalURLs,
getGeneratedLocation,
getOriginalLocation,
getOriginalSourceText,
applySourceMap,
clearSourceMaps
} = __webpack_require__(84);
// The interface is implemented in source-map to be
// easier to unit test.
const publicInterface = {
getOriginalURLs,
getGeneratedLocation,
getOriginalLocation,
getOriginalSourceText,
enableSourceMaps,
applySourceMap,
clearSourceMaps
};
@ -299,74 +85,10 @@ return /******/ (function(modules) { // webpackBootstrap
};
/***/ },
/* 1 */,
/* 2 */,
/* 3 */,
/* 4 */,
/* 5 */,
/* 6 */,
/* 7 */,
/* 8 */,
/* 9 */,
/* 10 */,
/* 11 */,
/* 12 */,
/* 13 */,
/* 14 */,
/* 15 */,
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */,
/* 21 */,
/* 22 */,
/* 23 */,
/* 24 */,
/* 25 */,
/* 26 */,
/* 27 */,
/* 28 */,
/* 29 */,
/* 30 */,
/* 31 */,
/* 32 */,
/* 33 */,
/* 34 */,
/* 35 */,
/* 36 */,
/* 37 */,
/* 38 */,
/* 39 */,
/* 40 */,
/* 41 */,
/* 42 */,
/* 43 */,
/* 44 */,
/* 45 */,
/* 46 */,
/* 47 */,
/* 48 */,
/* 49 */,
/* 50 */,
/* 51 */,
/* 52 */,
/* 53 */,
/* 54 */,
/* 55 */,
/* 56 */,
/* 57 */,
/* 58 */,
/* 59 */,
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
/* 64 */,
/* 65 */
/* 1 */
/***/ function(module, exports, __webpack_require__) {
const md5 = __webpack_require__(66);
const md5 = __webpack_require__(2);
function originalToGeneratedId(originalId) {
const match = originalId.match(/(.*)\/originalSource/);
@ -441,49 +163,23 @@ return /******/ (function(modules) { // webpackBootstrap
return "text/plain";
}
let msgId = 1;
function workerTask(worker, method) {
return function (...args) {
return new Promise((resolve, reject) => {
const id = msgId++;
worker.postMessage({ id, method, args });
const listener = ({ data: result }) => {
if (result.id !== id) {
return;
}
worker.removeEventListener("message", listener);
if (result.error) {
reject(result.error);
} else {
resolve(result.response);
}
};
worker.addEventListener("message", listener);
});
};
}
module.exports = {
originalToGeneratedId,
generatedToOriginalId,
isOriginalId,
isGeneratedId,
getContentType,
workerTask
getContentType
};
/***/ },
/* 66 */
/* 2 */
/***/ function(module, exports, __webpack_require__) {
(function(){
var crypt = __webpack_require__(67),
utf8 = __webpack_require__(68).utf8,
isBuffer = __webpack_require__(69),
bin = __webpack_require__(68).bin,
var crypt = __webpack_require__(3),
utf8 = __webpack_require__(4).utf8,
isBuffer = __webpack_require__(5),
bin = __webpack_require__(4).bin,
// The core
md5 = function (message, options) {
@ -642,7 +338,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 67 */
/* 3 */
/***/ function(module, exports) {
(function() {
@ -744,7 +440,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 68 */
/* 4 */
/***/ function(module, exports) {
var charenc = {
@ -783,7 +479,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 69 */
/* 5 */
/***/ function(module, exports) {
/*!
@ -810,7 +506,318 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 70 */
/* 6 */,
/* 7 */,
/* 8 */,
/* 9 */,
/* 10 */,
/* 11 */,
/* 12 */,
/* 13 */,
/* 14 */,
/* 15 */,
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */,
/* 21 */,
/* 22 */,
/* 23 */,
/* 24 */,
/* 25 */,
/* 26 */,
/* 27 */,
/* 28 */,
/* 29 */,
/* 30 */,
/* 31 */,
/* 32 */,
/* 33 */,
/* 34 */,
/* 35 */,
/* 36 */,
/* 37 */,
/* 38 */,
/* 39 */,
/* 40 */,
/* 41 */,
/* 42 */,
/* 43 */,
/* 44 */,
/* 45 */,
/* 46 */,
/* 47 */,
/* 48 */,
/* 49 */,
/* 50 */,
/* 51 */,
/* 52 */,
/* 53 */,
/* 54 */,
/* 55 */,
/* 56 */,
/* 57 */,
/* 58 */,
/* 59 */,
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
/* 64 */,
/* 65 */,
/* 66 */,
/* 67 */,
/* 68 */,
/* 69 */,
/* 70 */,
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
/* 75 */,
/* 76 */,
/* 77 */,
/* 78 */,
/* 79 */,
/* 80 */,
/* 81 */,
/* 82 */,
/* 83 */,
/* 84 */
/***/ function(module, exports, __webpack_require__) {
let _resolveAndFetch = (() => {
var _ref = _asyncToGenerator(function* (generatedSource) {
// Fetch the sourcemap over the network and create it.
const sourceMapURL = _resolveSourceMapURL(generatedSource);
const fetched = yield networkRequest(sourceMapURL, { loadFromCache: false });
// Create the source map and fix it up.
const map = new SourceMapConsumer(fetched.content);
_setSourceMapRoot(map, sourceMapURL, generatedSource);
return map;
});
return function _resolveAndFetch(_x) {
return _ref.apply(this, arguments);
};
})();
let getOriginalURLs = (() => {
var _ref2 = _asyncToGenerator(function* (generatedSource) {
const map = yield _fetchSourceMap(generatedSource);
return map && map.sources;
});
return function getOriginalURLs(_x2) {
return _ref2.apply(this, arguments);
};
})();
let getGeneratedLocation = (() => {
var _ref3 = _asyncToGenerator(function* (location, originalSource) {
if (!isOriginalId(location.sourceId)) {
return location;
}
const generatedSourceId = originalToGeneratedId(location.sourceId);
const map = yield _getSourceMap(generatedSourceId);
if (!map) {
return location;
}
const { line, column } = map.generatedPositionFor({
source: originalSource.url,
line: location.line,
column: location.column == null ? 0 : location.column,
bias: SourceMapConsumer.LEAST_UPPER_BOUND
});
return {
sourceId: generatedSourceId,
line: line,
// Treat 0 as no column so that line breakpoints work correctly.
column: column === 0 ? undefined : column
};
});
return function getGeneratedLocation(_x3, _x4) {
return _ref3.apply(this, arguments);
};
})();
let getOriginalLocation = (() => {
var _ref4 = _asyncToGenerator(function* (location) {
if (!isGeneratedId(location.sourceId)) {
return location;
}
const map = yield _getSourceMap(location.sourceId);
if (!map) {
return location;
}
const { source: url, line, column } = map.originalPositionFor({
line: location.line,
column: location.column == null ? Infinity : location.column
});
if (url == null) {
// No url means the location didn't map.
return location;
}
return {
sourceId: generatedToOriginalId(location.sourceId, url),
line,
column
};
});
return function getOriginalLocation(_x5) {
return _ref4.apply(this, arguments);
};
})();
let getOriginalSourceText = (() => {
var _ref5 = _asyncToGenerator(function* (originalSource) {
assert(isOriginalId(originalSource.id), "Source is not an original source");
const generatedSourceId = originalToGeneratedId(originalSource.id);
const map = yield _getSourceMap(generatedSourceId);
if (!map) {
return null;
}
let text = map.sourceContentFor(originalSource.url);
if (!text) {
text = (yield networkRequest(originalSource.url, { loadFromCache: false })).content;
}
return {
text,
contentType: getContentType(originalSource.url || "")
};
});
return function getOriginalSourceText(_x6) {
return _ref5.apply(this, arguments);
};
})();
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
/**
* Source Map Worker
* @module utils/source-map-worker
*/
const networkRequest = __webpack_require__(85);
const { parse } = __webpack_require__(86);
const path = __webpack_require__(93);
const { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(94);
const assert = __webpack_require__(105);
const {
originalToGeneratedId,
generatedToOriginalId,
isGeneratedId,
isOriginalId,
getContentType
} = __webpack_require__(1);
let sourceMapRequests = new Map();
function clearSourceMaps() {
sourceMapRequests.clear();
}
function _resolveSourceMapURL(source) {
const { url = "", sourceMapURL = "" } = source;
if (path.isURL(sourceMapURL) || url == "") {
// If it's already a full URL or the source doesn't have a URL,
// don't resolve anything.
return sourceMapURL;
} else if (path.isAbsolute(sourceMapURL)) {
// If it's an absolute path, it should be resolved relative to the
// host of the source.
const { protocol = "", host = "" } = parse(url);
return `${protocol}//${host}${sourceMapURL}`;
}
// Otherwise, it's a relative path and should be resolved relative
// to the source.
return `${path.dirname(url)}/${sourceMapURL}`;
}
/**
* Sets the source map's sourceRoot to be relative to the source map url.
* @memberof utils/source-map-worker
* @static
*/
function _setSourceMapRoot(sourceMap, absSourceMapURL, source) {
// No need to do this fiddling if we won't be fetching any sources over the
// wire.
if (sourceMap.hasContentsOfAllSources()) {
return;
}
const base = path.dirname(absSourceMapURL.indexOf("data:") === 0 && source.url ? source.url : absSourceMapURL);
if (sourceMap.sourceRoot) {
sourceMap.sourceRoot = path.join(base, sourceMap.sourceRoot);
} else {
sourceMap.sourceRoot = base;
}
return sourceMap;
}
function _getSourceMap(generatedSourceId) {
return sourceMapRequests.get(generatedSourceId);
}
function _fetchSourceMap(generatedSource) {
const existingRequest = sourceMapRequests.get(generatedSource.id);
if (existingRequest) {
// If it has already been requested, return the request. Make sure
// to do this even if sourcemapping is turned off, because
// pretty-printing uses sourcemaps.
//
// An important behavior here is that if it's in the middle of
// requesting it, all subsequent calls will block on the initial
// request.
return existingRequest;
} else if (!generatedSource.sourceMapURL) {
return Promise.resolve(null);
}
// Fire off the request, set it in the cache, and return it.
const req = _resolveAndFetch(generatedSource).catch(e => console.error(e));
sourceMapRequests.set(generatedSource.id, req);
return req;
}
function applySourceMap(generatedId, url, code, mappings) {
const generator = new SourceMapGenerator({ file: url });
mappings.forEach(mapping => generator.addMapping(mapping));
generator.setSourceContent(url, code);
const map = SourceMapConsumer(generator.toJSON());
sourceMapRequests.set(generatedId, Promise.resolve(map));
}
module.exports = {
getOriginalURLs,
getGeneratedLocation,
getOriginalLocation,
getOriginalSourceText,
applySourceMap,
clearSourceMaps
};
/***/ },
/* 85 */
/***/ function(module, exports) {
function networkRequest(url, opts) {
@ -843,9 +850,8 @@ return /******/ (function(modules) { // webpackBootstrap
module.exports = networkRequest;
/***/ },
/* 71 */
/* 86 */
/***/ function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
@ -871,8 +877,8 @@ return /******/ (function(modules) { // webpackBootstrap
'use strict';
var punycode = __webpack_require__(72);
var util = __webpack_require__(74);
var punycode = __webpack_require__(87);
var util = __webpack_require__(89);
exports.parse = urlParse;
exports.resolve = urlResolve;
@ -947,7 +953,7 @@ return /******/ (function(modules) { // webpackBootstrap
'gopher:': true,
'file:': true
},
querystring = __webpack_require__(75);
querystring = __webpack_require__(90);
function urlParse(url, parseQueryString, slashesDenoteHost) {
if (url && util.isObject(url) && url instanceof Url) return url;
@ -1583,7 +1589,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 72 */
/* 87 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */
@ -2115,10 +2121,10 @@ return /******/ (function(modules) { // webpackBootstrap
}(this));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73)(module), (function() { return this; }())))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(88)(module), (function() { return this; }())))
/***/ },
/* 73 */
/* 88 */
/***/ function(module, exports) {
module.exports = function(module) {
@ -2134,7 +2140,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 74 */
/* 89 */
/***/ function(module, exports) {
'use strict';
@ -2156,17 +2162,17 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 75 */
/* 90 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.decode = exports.parse = __webpack_require__(76);
exports.encode = exports.stringify = __webpack_require__(77);
exports.decode = exports.parse = __webpack_require__(91);
exports.encode = exports.stringify = __webpack_require__(92);
/***/ },
/* 76 */
/* 91 */
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
@ -2252,7 +2258,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 77 */
/* 92 */
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
@ -2322,7 +2328,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 78 */
/* 93 */
/***/ function(module, exports) {
function basename(path) {
@ -2351,7 +2357,7 @@ return /******/ (function(modules) { // webpackBootstrap
};
/***/ },
/* 79 */
/* 94 */
/***/ function(module, exports, __webpack_require__) {
/*
@ -2359,13 +2365,13 @@ return /******/ (function(modules) { // webpackBootstrap
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.SourceMapGenerator = __webpack_require__(80).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(86).SourceMapConsumer;
exports.SourceNode = __webpack_require__(89).SourceNode;
exports.SourceMapGenerator = __webpack_require__(95).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(101).SourceMapConsumer;
exports.SourceNode = __webpack_require__(104).SourceNode;
/***/ },
/* 80 */
/* 95 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -2375,10 +2381,10 @@ return /******/ (function(modules) { // webpackBootstrap
* http://opensource.org/licenses/BSD-3-Clause
*/
var base64VLQ = __webpack_require__(81);
var util = __webpack_require__(83);
var ArraySet = __webpack_require__(84).ArraySet;
var MappingList = __webpack_require__(85).MappingList;
var base64VLQ = __webpack_require__(96);
var util = __webpack_require__(98);
var ArraySet = __webpack_require__(99).ArraySet;
var MappingList = __webpack_require__(100).MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
@ -2775,7 +2781,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 81 */
/* 96 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -2815,7 +2821,7 @@ return /******/ (function(modules) { // webpackBootstrap
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var base64 = __webpack_require__(82);
var base64 = __webpack_require__(97);
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
@ -2921,7 +2927,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 82 */
/* 97 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -2994,7 +3000,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 83 */
/* 98 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3417,7 +3423,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 84 */
/* 99 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3427,7 +3433,7 @@ return /******/ (function(modules) { // webpackBootstrap
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(83);
var util = __webpack_require__(98);
var has = Object.prototype.hasOwnProperty;
/**
@ -3527,7 +3533,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 85 */
/* 100 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3537,7 +3543,7 @@ return /******/ (function(modules) { // webpackBootstrap
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(83);
var util = __webpack_require__(98);
/**
* Determine whether mappingB is after mappingA with respect to generated
@ -3612,7 +3618,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 86 */
/* 101 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -3622,11 +3628,11 @@ return /******/ (function(modules) { // webpackBootstrap
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(83);
var binarySearch = __webpack_require__(87);
var ArraySet = __webpack_require__(84).ArraySet;
var base64VLQ = __webpack_require__(81);
var quickSort = __webpack_require__(88).quickSort;
var util = __webpack_require__(98);
var binarySearch = __webpack_require__(102);
var ArraySet = __webpack_require__(99).ArraySet;
var base64VLQ = __webpack_require__(96);
var quickSort = __webpack_require__(103).quickSort;
function SourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
@ -4700,7 +4706,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 87 */
/* 102 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4817,7 +4823,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 88 */
/* 103 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4937,7 +4943,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 89 */
/* 104 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@ -4947,8 +4953,8 @@ return /******/ (function(modules) { // webpackBootstrap
* http://opensource.org/licenses/BSD-3-Clause
*/
var SourceMapGenerator = __webpack_require__(80).SourceMapGenerator;
var util = __webpack_require__(83);
var SourceMapGenerator = __webpack_require__(95).SourceMapGenerator;
var util = __webpack_require__(98);
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
@ -5350,7 +5356,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 90 */
/* 105 */
/***/ function(module, exports) {
function assert(condition, message) {

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

@ -6,8 +6,8 @@ pref(dom.animations-api.core.enabled,true) load 1216842-3.html
pref(dom.animations-api.core.enabled,true) load 1216842-4.html
pref(dom.animations-api.core.enabled,true) load 1216842-5.html # bug 1334036
pref(dom.animations-api.core.enabled,true) load 1216842-6.html # bug 1334036
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1272475-1.html # bug 1324693 and bug 1332657 and bug 1336769
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1272475-2.html # bug 1324693 and bug 1332657 and bug 1336769
pref(dom.animations-api.core.enabled,true) load 1272475-1.html
pref(dom.animations-api.core.enabled,true) load 1272475-2.html
pref(dom.animations-api.core.enabled,true) load 1278485-1.html
pref(dom.animations-api.core.enabled,true) load 1277272-1.html
pref(dom.animations-api.core.enabled,true) load 1290535-1.html

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

@ -293,6 +293,9 @@ bool nsContentUtils::sPrivacyResistFingerprinting = false;
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
bool nsContentUtils::sUseActivityCursor = false;
int32_t nsContentUtils::sPrivacyMaxInnerWidth = 1000;
int32_t nsContentUtils::sPrivacyMaxInnerHeight = 1000;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
uint32_t nsContentUtils::sCookiesLifetimePolicy = nsICookieService::ACCEPT_NORMALLY;
@ -591,6 +594,14 @@ nsContentUtils::Init()
Preferences::AddBoolVarCache(&sPrivacyResistFingerprinting,
"privacy.resistFingerprinting", false);
Preferences::AddIntVarCache(&sPrivacyMaxInnerWidth,
"privacy.window.maxInnerWidth",
1000);
Preferences::AddIntVarCache(&sPrivacyMaxInnerHeight,
"privacy.window.maxInnerHeight",
1000);
Preferences::AddUintVarCache(&sHandlingInputTimeout,
"dom.event.handling-user-input-time-limit",
1000);
@ -2137,6 +2148,13 @@ nsContentUtils::IsCallerChrome()
return xpc::IsUniversalXPConnectEnabled(GetCurrentJSContext());
}
/* static */
bool
nsContentUtils::ShouldResistFingerprinting()
{
return sPrivacyResistFingerprinting;
}
bool
nsContentUtils::ShouldResistFingerprinting(nsIDocShell* aDocShell)
{
@ -2147,6 +2165,77 @@ nsContentUtils::ShouldResistFingerprinting(nsIDocShell* aDocShell)
return !isChrome && sPrivacyResistFingerprinting;
}
/* static */
void
nsContentUtils::CalcRoundedWindowSizeForResistingFingerprinting(int32_t aChromeWidth,
int32_t aChromeHeight,
int32_t aScreenWidth,
int32_t aScreenHeight,
int32_t aInputWidth,
int32_t aInputHeight,
bool aSetOuterWidth,
bool aSetOuterHeight,
int32_t* aOutputWidth,
int32_t* aOutputHeight)
{
MOZ_ASSERT(aOutputWidth);
MOZ_ASSERT(aOutputHeight);
int32_t availContentWidth = 0;
int32_t availContentHeight = 0;
availContentWidth = std::min(sPrivacyMaxInnerWidth,
aScreenWidth - aChromeWidth);
#ifdef MOZ_WIDGET_GTK
// In the GTK window, it will not report outside system decorations
// when we get available window size, see Bug 581863. So, we leave a
// 40 pixels space for them when calculating the available content
// height. It is not necessary for the width since the content width
// is usually pretty much the same as the chrome width.
availContentHeight = std::min(sPrivacyMaxInnerHeight,
(-40 + aScreenHeight) - aChromeHeight);
#else
availContentHeight = std::min(sPrivacyMaxInnerHeight,
aScreenHeight - aChromeHeight);
#endif
// Ideally, we'd like to round window size to 1000x1000, but the
// screen space could be too small to accommodate this size in some
// cases. If it happens, we would round the window size to the nearest
// 200x100.
availContentWidth = availContentWidth - (availContentWidth % 200);
availContentHeight = availContentHeight - (availContentHeight % 100);
// If aIsOuter is true, we are setting the outer window. So we
// have to consider the chrome UI.
int32_t chromeOffsetWidth = aSetOuterWidth ? aChromeWidth : 0;
int32_t chromeOffsetHeight = aSetOuterHeight ? aChromeHeight : 0;
int32_t resultWidth = 0, resultHeight = 0;
// if the original size is greater than the maximum available size, we set
// it to the maximum size. And if the original value is less than the
// minimum rounded size, we set it to the minimum 200x100.
if (aInputWidth > (availContentWidth + chromeOffsetWidth)) {
resultWidth = availContentWidth + chromeOffsetWidth;
} else if (aInputWidth < (200 + chromeOffsetWidth)) {
resultWidth = 200 + chromeOffsetWidth;
} else {
// Otherwise, we round the window to the nearest upper rounded 200x100.
resultWidth = NSToIntCeil((aInputWidth - chromeOffsetWidth) / 200.0) * 200 + chromeOffsetWidth;
}
if (aInputHeight > (availContentHeight + chromeOffsetHeight)) {
resultHeight = availContentHeight + chromeOffsetHeight;
} else if (aInputHeight < (100 + chromeOffsetHeight)) {
resultHeight = 100 + chromeOffsetHeight;
} else {
resultHeight = NSToIntCeil((aInputHeight - chromeOffsetHeight) / 100.0) * 100 + chromeOffsetHeight;
}
*aOutputWidth = resultWidth;
*aOutputHeight = resultHeight;
}
bool
nsContentUtils::ThreadsafeIsCallerChrome()
{

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

@ -265,8 +265,25 @@ public:
JS::MutableHandle<JS::PropertyDescriptor> aDesc);
// Check whether we should avoid leaking distinguishing information to JS/CSS.
static bool ShouldResistFingerprinting();
static bool ShouldResistFingerprinting(nsIDocShell* aDocShell);
// A helper function to calculate the rounded window size for fingerprinting
// resistance. The rounded size is based on the chrome UI size and available
// screen size. If the inputWidth/Height is greater than the available content
// size, this will report the available content size. Otherwise, it will
// round the size to the nearest upper 200x100.
static void CalcRoundedWindowSizeForResistingFingerprinting(int32_t aChromeWidth,
int32_t aChromeHeight,
int32_t aScreenWidth,
int32_t aScreenHeight,
int32_t aInputWidth,
int32_t aInputHeight,
bool aSetOuterWidth,
bool aSetOuterHeight,
int32_t* aOutputWidth,
int32_t* aOutputHeight);
/**
* Returns the parent node of aChild crossing document boundaries.
* Uses the parent node in the composed document.
@ -2933,6 +2950,9 @@ private:
static uint32_t sCookiesLifetimePolicy;
static uint32_t sCookiesBehavior;
static int32_t sPrivacyMaxInnerWidth;
static int32_t sPrivacyMaxInnerHeight;
static nsHtml5StringParser* sHTMLFragmentParser;
static nsIParser* sXMLFragmentParser;
static nsIFragmentContentSink* sXMLFragmentSink;

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

@ -14798,6 +14798,101 @@ nsGlobalWindow::SetReplaceableWindowCoord(JSContext* aCx,
return;
}
if (nsContentUtils::ShouldResistFingerprinting(GetDocShell())) {
bool innerWidthSpecified = false;
bool innerHeightSpecified = false;
bool outerWidthSpecified = false;
bool outerHeightSpecified = false;
if (strcmp(aPropName, "innerWidth") == 0) {
innerWidthSpecified = true;
} else if (strcmp(aPropName, "innerHeight") == 0) {
innerHeightSpecified = true;
} else if (strcmp(aPropName, "outerWidth") == 0) {
outerWidthSpecified = true;
} else if (strcmp(aPropName, "outerHeight") == 0) {
outerHeightSpecified = true;
}
if (innerWidthSpecified || innerHeightSpecified ||
outerWidthSpecified || outerHeightSpecified)
{
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = outer->GetTreeOwnerWindow();
nsCOMPtr<nsIScreen> screen;
nsCOMPtr<nsIScreenManager> screenMgr(
do_GetService("@mozilla.org/gfx/screenmanager;1"));
int32_t winLeft = 0;
int32_t winTop = 0;
int32_t winWidth = 0;
int32_t winHeight = 0;
double scale = 1.0;
if (treeOwnerAsWin && screenMgr) {
// Acquire current window size.
treeOwnerAsWin->GetUnscaledDevicePixelsPerCSSPixel(&scale);
treeOwnerAsWin->GetPositionAndSize(&winLeft, &winTop, &winWidth, &winHeight);
winLeft = NSToIntRound(winHeight / scale);
winTop = NSToIntRound(winWidth / scale);
winWidth = NSToIntRound(winWidth / scale);
winHeight = NSToIntRound(winHeight / scale);
// Acquire content window size.
CSSIntSize contentSize;
outer->GetInnerSize(contentSize);
screenMgr->ScreenForRect(winLeft, winTop, winWidth, winHeight,
getter_AddRefs(screen));
if (screen) {
int32_t* targetContentWidth = nullptr;
int32_t* targetContentHeight = nullptr;
int32_t screenWidth = 0;
int32_t screenHeight = 0;
int32_t chromeWidth = 0;
int32_t chromeHeight = 0;
int32_t inputWidth = 0;
int32_t inputHeight = 0;
int32_t unused = 0;
// Get screen dimensions (in device pixels)
screen->GetAvailRect(&unused, &unused, &screenWidth,
&screenHeight);
// Convert them to CSS pixels
screenWidth = NSToIntRound(screenWidth / scale);
screenHeight = NSToIntRound(screenHeight / scale);
// Calculate the chrome UI size.
chromeWidth = winWidth - contentSize.width;
chromeHeight = winHeight - contentSize.height;
if (innerWidthSpecified || outerWidthSpecified) {
inputWidth = value;
targetContentWidth = &value;
targetContentHeight = &unused;
} else if (innerHeightSpecified || outerHeightSpecified) {
inputHeight = value;
targetContentWidth = &unused;
targetContentHeight = &value;
}
nsContentUtils::CalcRoundedWindowSizeForResistingFingerprinting(
chromeWidth,
chromeHeight,
screenWidth,
screenHeight,
inputWidth,
inputHeight,
outerWidthSpecified,
outerHeightSpecified,
targetContentWidth,
targetContentHeight
);
}
}
}
}
(this->*aSetter)(value, aCallerType, aError);
}

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

@ -12,8 +12,6 @@
namespace mozilla {
#define NS_EVENT_STATE_HIGHEST_SERVO_BIT 21
/**
* EventStates is the class used to represent the event states of nsIContent
* instances. These states are calculated by IntrinsicState() and
@ -163,7 +161,7 @@ public:
*/
ServoType ServoValue() const
{
return mStates & ((1 << (NS_EVENT_STATE_HIGHEST_SERVO_BIT + 1)) - 1);
return mStates;
}
private:
@ -223,87 +221,73 @@ private:
#define NS_EVENT_STATE_INVALID NS_DEFINE_EVENT_STATE_MACRO(11)
// UI friendly version of :valid pseudo-class.
#define NS_EVENT_STATE_MOZ_UI_VALID NS_DEFINE_EVENT_STATE_MACRO(12)
// UI friendly version of :invalid pseudo-class.
#define NS_EVENT_STATE_MOZ_UI_INVALID NS_DEFINE_EVENT_STATE_MACRO(13)
// Content could not be rendered (image/object/etc).
#define NS_EVENT_STATE_BROKEN NS_DEFINE_EVENT_STATE_MACRO(13)
#define NS_EVENT_STATE_BROKEN NS_DEFINE_EVENT_STATE_MACRO(14)
// Content disabled by the user (images turned off, say).
#define NS_EVENT_STATE_USERDISABLED NS_DEFINE_EVENT_STATE_MACRO(14)
#define NS_EVENT_STATE_USERDISABLED NS_DEFINE_EVENT_STATE_MACRO(15)
// Content suppressed by the user (ad blocking, etc).
#define NS_EVENT_STATE_SUPPRESSED NS_DEFINE_EVENT_STATE_MACRO(15)
#define NS_EVENT_STATE_SUPPRESSED NS_DEFINE_EVENT_STATE_MACRO(16)
// Content is still loading such that there is nothing to show the
// user (eg an image which hasn't started coming in yet).
#define NS_EVENT_STATE_LOADING NS_DEFINE_EVENT_STATE_MACRO(16)
#define NS_EVENT_STATE_LOADING NS_DEFINE_EVENT_STATE_MACRO(17)
// Handler for the content has been blocked.
#define NS_EVENT_STATE_HANDLER_BLOCKED NS_DEFINE_EVENT_STATE_MACRO(17)
#define NS_EVENT_STATE_HANDLER_BLOCKED NS_DEFINE_EVENT_STATE_MACRO(18)
// Handler for the content has been disabled.
#define NS_EVENT_STATE_HANDLER_DISABLED NS_DEFINE_EVENT_STATE_MACRO(18)
#define NS_EVENT_STATE_HANDLER_DISABLED NS_DEFINE_EVENT_STATE_MACRO(19)
// Handler for the content has crashed
#define NS_EVENT_STATE_HANDLER_CRASHED NS_DEFINE_EVENT_STATE_MACRO(19)
#define NS_EVENT_STATE_HANDLER_CRASHED NS_DEFINE_EVENT_STATE_MACRO(20)
// Content is required.
#define NS_EVENT_STATE_REQUIRED NS_DEFINE_EVENT_STATE_MACRO(20)
#define NS_EVENT_STATE_REQUIRED NS_DEFINE_EVENT_STATE_MACRO(21)
// Content is optional (and can be required).
#define NS_EVENT_STATE_OPTIONAL NS_DEFINE_EVENT_STATE_MACRO(21)
/*
* Bits below here do not have Servo-related ordering constraints.
*
* Remember to change NS_EVENT_STATE_HIGHEST_SERVO_BIT at the top of the file if
* this changes!
*/
// Drag is hovering over content.
#define NS_EVENT_STATE_DRAGOVER NS_DEFINE_EVENT_STATE_MACRO(22)
#define NS_EVENT_STATE_OPTIONAL NS_DEFINE_EVENT_STATE_MACRO(22)
// Element is an unresolved custom element candidate
#define NS_EVENT_STATE_UNRESOLVED NS_DEFINE_EVENT_STATE_MACRO(23)
// Link has been visited.
#define NS_EVENT_STATE_VISITED NS_DEFINE_EVENT_STATE_MACRO(23)
#define NS_EVENT_STATE_VISITED NS_DEFINE_EVENT_STATE_MACRO(24)
// Link hasn't been visited.
#define NS_EVENT_STATE_UNVISITED NS_DEFINE_EVENT_STATE_MACRO(24)
#define NS_EVENT_STATE_UNVISITED NS_DEFINE_EVENT_STATE_MACRO(25)
// Drag is hovering over content.
#define NS_EVENT_STATE_DRAGOVER NS_DEFINE_EVENT_STATE_MACRO(26)
// Content value is in-range (and can be out-of-range).
#define NS_EVENT_STATE_INRANGE NS_DEFINE_EVENT_STATE_MACRO(25)
#define NS_EVENT_STATE_INRANGE NS_DEFINE_EVENT_STATE_MACRO(27)
// Content value is out-of-range.
#define NS_EVENT_STATE_OUTOFRANGE NS_DEFINE_EVENT_STATE_MACRO(26)
#define NS_EVENT_STATE_OUTOFRANGE NS_DEFINE_EVENT_STATE_MACRO(28)
// These two are temporary (see bug 302188)
// Content is read-only.
#define NS_EVENT_STATE_MOZ_READONLY NS_DEFINE_EVENT_STATE_MACRO(27)
#define NS_EVENT_STATE_MOZ_READONLY NS_DEFINE_EVENT_STATE_MACRO(29)
// Content is editable.
#define NS_EVENT_STATE_MOZ_READWRITE NS_DEFINE_EVENT_STATE_MACRO(28)
#define NS_EVENT_STATE_MOZ_READWRITE NS_DEFINE_EVENT_STATE_MACRO(30)
// Content is the default one (meaning depends of the context).
#define NS_EVENT_STATE_DEFAULT NS_DEFINE_EVENT_STATE_MACRO(29)
#define NS_EVENT_STATE_INCREMENT_SCRIPT_LEVEL NS_DEFINE_EVENT_STATE_MACRO(30)
// Content has focus and should show a ring.
#define NS_EVENT_STATE_FOCUSRING NS_DEFINE_EVENT_STATE_MACRO(31)
#define NS_EVENT_STATE_DEFAULT NS_DEFINE_EVENT_STATE_MACRO(31)
// Content is a submit control and the form isn't valid.
#define NS_EVENT_STATE_MOZ_SUBMITINVALID NS_DEFINE_EVENT_STATE_MACRO(32)
// UI friendly version of :invalid pseudo-class.
#define NS_EVENT_STATE_MOZ_UI_INVALID NS_DEFINE_EVENT_STATE_MACRO(33)
// This bit is currently free.
// #define NS_EVENT_STATE_?????????? NS_DEFINE_EVENT_STATE_MACRO(34)
// Handler for click to play plugin
#define NS_EVENT_STATE_TYPE_CLICK_TO_PLAY NS_DEFINE_EVENT_STATE_MACRO(35)
// Content is in the optimum region.
#define NS_EVENT_STATE_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(36)
#define NS_EVENT_STATE_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(33)
// Content is in the suboptimal region.
#define NS_EVENT_STATE_SUB_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(37)
#define NS_EVENT_STATE_SUB_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(34)
// Content is in the sub-suboptimal region.
#define NS_EVENT_STATE_SUB_SUB_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(38)
// Handler for click to play plugin (vulnerable w/update)
#define NS_EVENT_STATE_VULNERABLE_UPDATABLE NS_DEFINE_EVENT_STATE_MACRO(39)
// Handler for click to play plugin (vulnerable w/no update)
#define NS_EVENT_STATE_VULNERABLE_NO_UPDATE NS_DEFINE_EVENT_STATE_MACRO(40)
// Element is ltr (for :dir pseudo-class)
#define NS_EVENT_STATE_LTR NS_DEFINE_EVENT_STATE_MACRO(42)
// Element is rtl (for :dir pseudo-class)
#define NS_EVENT_STATE_RTL NS_DEFINE_EVENT_STATE_MACRO(43)
// This bit is currently free.
// #define NS_EVENT_STATE_?????????? NS_DEFINE_EVENT_STATE_MACRO(44)
#define NS_EVENT_STATE_SUB_SUB_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(35)
// Element is highlighted (devtools inspector)
#define NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED NS_DEFINE_EVENT_STATE_MACRO(45)
// Element is an unresolved custom element candidate
#define NS_EVENT_STATE_UNRESOLVED NS_DEFINE_EVENT_STATE_MACRO(46)
#define NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED NS_DEFINE_EVENT_STATE_MACRO(36)
// Element is transitioning for rules changed by style editor
#define NS_EVENT_STATE_STYLEEDITOR_TRANSITIONING NS_DEFINE_EVENT_STATE_MACRO(47)
// This bit is currently free.
// #define NS_EVENT_STATE_?????????? NS_DEFINE_EVENT_STATE_MACRO(48)
#define NS_EVENT_STATE_STYLEEDITOR_TRANSITIONING NS_DEFINE_EVENT_STATE_MACRO(37)
#define NS_EVENT_STATE_INCREMENT_SCRIPT_LEVEL NS_DEFINE_EVENT_STATE_MACRO(38)
// Content has focus and should show a ring.
#define NS_EVENT_STATE_FOCUSRING NS_DEFINE_EVENT_STATE_MACRO(39)
// Handler for click to play plugin
#define NS_EVENT_STATE_TYPE_CLICK_TO_PLAY NS_DEFINE_EVENT_STATE_MACRO(40)
// Handler for click to play plugin (vulnerable w/update)
#define NS_EVENT_STATE_VULNERABLE_UPDATABLE NS_DEFINE_EVENT_STATE_MACRO(41)
// Handler for click to play plugin (vulnerable w/no update)
#define NS_EVENT_STATE_VULNERABLE_NO_UPDATE NS_DEFINE_EVENT_STATE_MACRO(42)
// Element has focus-within.
#define NS_EVENT_STATE_FOCUS_WITHIN NS_DEFINE_EVENT_STATE_MACRO(49)
#define NS_EVENT_STATE_FOCUS_WITHIN NS_DEFINE_EVENT_STATE_MACRO(43)
// Element is ltr (for :dir pseudo-class)
#define NS_EVENT_STATE_LTR NS_DEFINE_EVENT_STATE_MACRO(44)
// Element is rtl (for :dir pseudo-class)
#define NS_EVENT_STATE_RTL NS_DEFINE_EVENT_STATE_MACRO(45)
// Event state that is used for values that need to be parsed but do nothing.
#define NS_EVENT_STATE_IGNORE NS_DEFINE_EVENT_STATE_MACRO(63)

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

@ -113,8 +113,8 @@ GamepadManager::StopMonitoring()
mGamepads.Clear();
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(XP_LINUX)
mVRChannelChild = gfx::VRManagerChild::Get();
mVRChannelChild->SendControllerListenerRemoved();
gfx::VRManagerChild* vm = gfx::VRManagerChild::Get();
vm->SendControllerListenerRemoved();
#endif
}
@ -681,10 +681,11 @@ GamepadManager::VibrateHaptic(uint32_t aControllerIdx, uint32_t aHapticIndex,
if (aControllerIdx >= VR_GAMEPAD_IDX_OFFSET) {
uint32_t index = aControllerIdx - VR_GAMEPAD_IDX_OFFSET;
mVRChannelChild->AddPromise(mPromiseID, promise);
mVRChannelChild->SendVibrateHaptic(index, aHapticIndex,
aIntensity, aDuration,
mPromiseID);
gfx::VRManagerChild* vm = gfx::VRManagerChild::Get();
vm->AddPromise(mPromiseID, promise);
vm->SendVibrateHaptic(index, aHapticIndex,
aIntensity, aDuration,
mPromiseID);
} else {
for (const auto& channelChild: mChannelChildren) {
channelChild->AddPromise(mPromiseID, promise);
@ -705,7 +706,8 @@ GamepadManager::StopHaptics()
const uint32_t gamepadIndex = iter.UserData()->HashKey();
if (gamepadIndex >= VR_GAMEPAD_IDX_OFFSET) {
const uint32_t index = gamepadIndex - VR_GAMEPAD_IDX_OFFSET;
mVRChannelChild->SendStopVibrateHaptic(index);
gfx::VRManagerChild* vm = gfx::VRManagerChild::Get();
vm->SendStopVibrateHaptic(index);
} else {
for (auto& channelChild : mChannelChildren) {
channelChild->SendStopVibrateHaptic(gamepadIndex);
@ -733,8 +735,8 @@ GamepadManager::ActorCreated(PBackgroundChild *aActor)
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(XP_LINUX)
// Construct VRManagerChannel and ask adding the connected
// VR controllers to GamepadManager
mVRChannelChild = gfx::VRManagerChild::Get();
mVRChannelChild->SendControllerListenerAdded();
gfx::VRManagerChild* vm = gfx::VRManagerChild::Get();
vm->SendControllerListenerAdded();
#endif
}

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

@ -131,7 +131,6 @@ class GamepadManager final : public nsIObserver,
// will be destroyed during the IPDL shutdown chain, so we
// don't need to refcount it here.
nsTArray<GamepadEventChannelChild *> mChannelChildren;
gfx::VRManagerChild* mVRChannelChild;
private:

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

@ -50,7 +50,7 @@ fails == bug917595-exif-rotated.jpg bug917595-exif-rotated.jpg
== bug1106522-1.html bug1106522-1.html
== bug1106522-2.html bug1106522-2.html
fails == href-attr-change-restyles.html href-attr-change-restyles.html
== href-attr-change-restyles.html href-attr-change-restyles.html
== figure.html figure.html
== pre-1.html pre-1.html
== table-border-1.html table-border-1.html

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

@ -16,7 +16,7 @@ fails == passwd-3.html passwd-3.html
fails needs-focus == passwd-4.html passwd-4.html
fails == emptypasswd-1.html emptypasswd-1.html
fails == emptypasswd-2.html emptypasswd-2.html
fails == caret_on_positioned.html caret_on_positioned.html
== caret_on_positioned.html caret_on_positioned.html
fails == spellcheck-input-disabled.html spellcheck-input-disabled.html
fails == spellcheck-input-attr-before.html spellcheck-input-attr-before.html
fails == spellcheck-input-attr-before.html spellcheck-input-attr-before.html
@ -57,7 +57,7 @@ fails == spellcheck-textarea-attr-dynamic-override.html spellcheck-textarea-attr
fails == spellcheck-textarea-attr-dynamic-override-inherit.html spellcheck-textarea-attr-dynamic-override-inherit.html
fails == spellcheck-textarea-property-dynamic-override.html spellcheck-textarea-property-dynamic-override.html
fails == spellcheck-textarea-property-dynamic-override-inherit.html spellcheck-textarea-property-dynamic-override-inherit.html
fails needs-focus == caret_on_focus.html caret_on_focus.html
needs-focus == caret_on_focus.html caret_on_focus.html
fails needs-focus == caret_on_textarea_lastline.html caret_on_textarea_lastline.html
fails needs-focus == input-text-onfocus-reframe.html input-text-onfocus-reframe.html
fails needs-focus == input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe.html
@ -89,18 +89,18 @@ fails == selection_visibility_after_reframe-2.html selection_visibility_after_re
fails == selection_visibility_after_reframe-3.html selection_visibility_after_reframe-3.html
== 672709.html 672709.html
fails == 338427-1.html 338427-1.html
fails == 674212-spellcheck.html 674212-spellcheck.html
fails == 338427-2.html 338427-2.html
== 674212-spellcheck.html 674212-spellcheck.html
== 338427-2.html 338427-2.html
fails == 338427-3.html 338427-3.html
fails == 462758-grabbers-resizers.html 462758-grabbers-resizers.html
== 462758-grabbers-resizers.html 462758-grabbers-resizers.html
fails == readwrite-non-editable.html readwrite-non-editable.html
fails == readwrite-editable.html readwrite-editable.html
fails == readonly-non-editable.html readonly-non-editable.html
fails == readonly-editable.html readonly-editable.html
fails == dynamic-overflow-change.html dynamic-overflow-change.html
fails == 694880-1.html 694880-1.html
fails == 694880-2.html 694880-2.html
fails == 694880-3.html 694880-3.html
== 694880-1.html 694880-1.html
== 694880-2.html 694880-2.html
== 694880-3.html 694880-3.html
== 388980-1.html 388980-1.html
fails needs-focus == spellcheck-superscript-1.html spellcheck-superscript-1.html
fails == spellcheck-superscript-2.html spellcheck-superscript-2.html
@ -132,6 +132,6 @@ needs-focus == spellcheck-contenteditable-focused-reframe.html spellcheck-conten
== spellcheck-contenteditable-property-dynamic-override.html spellcheck-contenteditable-property-dynamic-override.html
== spellcheck-contenteditable-property-dynamic-override-inherit.html spellcheck-contenteditable-property-dynamic-override-inherit.html
== 911201.html 911201.html
fails needs-focus == 969773.html 969773.html
needs-focus == 969773.html 969773.html
fails == 997805.html 997805.html
fails == 1088158.html 1088158.html

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

@ -29,6 +29,7 @@
#include "gfxVROculus.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/dom/GamepadEventTypes.h"
#include "mozilla/dom/GamepadBinding.h"
@ -145,7 +146,7 @@ enum class OculusRightControllerButtonType : uint16_t {
static const uint32_t kNumOculusButton = static_cast<uint32_t>
(OculusLeftControllerButtonType::
NumButtonType);
static const uint32_t kNumOculusHaptcs = 0; // TODO: Bug 1305892
static const uint32_t kNumOculusHaptcs = 1;
static bool
@ -886,6 +887,8 @@ VRControllerOculus::VRControllerOculus(dom::GamepadHand aHand)
: VRControllerHost(VRDeviceType::Oculus)
, mIndexTrigger(0.0f)
, mHandTrigger(0.0f)
, mVibrateThread(nullptr)
, mIsVibrateStopped(false)
{
MOZ_COUNT_CTOR_INHERITED(VRControllerOculus, VRControllerHost);
@ -957,6 +960,144 @@ VRControllerOculus::~VRControllerOculus()
MOZ_COUNT_DTOR_INHERITED(VRControllerOculus, VRControllerHost);
}
void
VRControllerOculus::UpdateVibrateHaptic(ovrSession aSession,
uint32_t aHapticIndex,
double aIntensity,
double aDuration,
uint64_t aVibrateIndex,
uint32_t aPromiseID)
{
// UpdateVibrateHaptic() only can be called by mVibrateThread
MOZ_ASSERT(mVibrateThread == NS_GetCurrentThread());
// It has been interrupted by loss focus.
if (mIsVibrateStopped) {
VibrateHapticComplete(aSession, aPromiseID, true);
return;
}
// Avoid the previous vibrate event to override the new one.
if (mVibrateIndex != aVibrateIndex) {
VibrateHapticComplete(aSession, aPromiseID, false);
return;
}
const double duration = (aIntensity == 0) ? 0 : aDuration;
// Vibration amplitude in the [0.0, 1.0] range.
const float amplitude = aIntensity > 1.0 ? 1.0 : aIntensity;
// Vibration is enabled by specifying the frequency.
// Specifying 0.0f will disable the vibration, 0.5f will vibrate at 160Hz,
// and 1.0f will vibrate at 320Hz.
const float frequency = (duration > 0) ? 1.0f : 0.0f;
ovrControllerType hand;
switch (GetHand()) {
case GamepadHand::Left:
hand = ovrControllerType::ovrControllerType_LTouch;
break;
case GamepadHand::Right:
hand = ovrControllerType::ovrControllerType_RTouch;
break;
default:
MOZ_ASSERT(false);
break;
}
// Oculus Touch only can get the response from ovr_SetControllerVibration()
// at the presenting mode.
ovrResult result = ovr_SetControllerVibration(aSession, hand, frequency,
(frequency == 0.0f) ? 0.0f : amplitude);
if (result != ovrSuccess) {
printf_stderr("%s hand ovr_SetControllerVibration skipped.\n",
GamepadHandValues::strings[uint32_t(GetHand())].value);
}
// In Oculus dev doc, it mentions vibration lasts for a maximum of 2.5 seconds
// at ovr_SetControllerVibration(), but we found 2.450 sec is more close to the
// real looping use case.
const double kVibrateRate = 2450.0;
const double remainingTime = (duration > kVibrateRate)
? (duration - kVibrateRate) : duration;
if (remainingTime) {
MOZ_ASSERT(mVibrateThread);
RefPtr<Runnable> runnable =
NewRunnableMethod<ovrSession, uint32_t, double, double, uint64_t, uint32_t>
(this, &VRControllerOculus::UpdateVibrateHaptic, aSession,
aHapticIndex, aIntensity, (duration > kVibrateRate) ? remainingTime : 0, aVibrateIndex, aPromiseID);
NS_DelayedDispatchToCurrentThread(runnable.forget(),
(duration > kVibrateRate) ? kVibrateRate : remainingTime);
} else {
VibrateHapticComplete(aSession, aPromiseID, true);
}
}
void
VRControllerOculus::VibrateHapticComplete(ovrSession aSession, uint32_t aPromiseID,
bool aStop)
{
if (aStop) {
ovrControllerType hand;
switch (GetHand()) {
case GamepadHand::Left:
hand = ovrControllerType::ovrControllerType_LTouch;
break;
case GamepadHand::Right:
hand = ovrControllerType::ovrControllerType_RTouch;
break;
default:
MOZ_ASSERT(false);
break;
}
ovrResult result = ovr_SetControllerVibration(aSession, hand, 0.0f, 0.0f);
if (result != ovrSuccess) {
printf_stderr("%s Haptics skipped.\n",
GamepadHandValues::strings[uint32_t(GetHand())].value);
}
}
VRManager *vm = VRManager::Get();
MOZ_ASSERT(vm);
CompositorThreadHolder::Loop()->PostTask(NewRunnableMethod<uint32_t>
(vm, &VRManager::NotifyVibrateHapticCompleted, aPromiseID));
}
void
VRControllerOculus::VibrateHaptic(ovrSession aSession,
uint32_t aHapticIndex,
double aIntensity,
double aDuration,
uint32_t aPromiseID)
{
// Spinning up the haptics thread at the first haptics call.
if (!mVibrateThread) {
nsresult rv = NS_NewThread(getter_AddRefs(mVibrateThread));
MOZ_ASSERT(mVibrateThread);
if (NS_FAILED(rv)) {
MOZ_ASSERT(false, "Failed to create async thread.");
}
}
++mVibrateIndex;
mIsVibrateStopped = false;
RefPtr<Runnable> runnable =
NewRunnableMethod<ovrSession, uint32_t, double, double, uint64_t, uint32_t>
(this, &VRControllerOculus::UpdateVibrateHaptic, aSession,
aHapticIndex, aIntensity, aDuration, mVibrateIndex, aPromiseID);
mVibrateThread->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL);
}
void
VRControllerOculus::StopVibrateHaptic()
{
mIsVibrateStopped = true;
}
/*static*/ already_AddRefed<VRSystemManagerOculus>
VRSystemManagerOculus::Create()
{
@ -1262,12 +1403,31 @@ VRSystemManagerOculus::VibrateHaptic(uint32_t aControllerIdx,
double aDuration,
uint32_t aPromiseID)
{
// TODO: Bug 1305892
// mSession is available after VRDisplay is created
// at GetHMDs().
if (!mSession) {
return;
}
RefPtr<impl::VRControllerOculus> controller = mOculusController[aControllerIdx];
MOZ_ASSERT(controller);
controller->VibrateHaptic(mSession, aHapticIndex, aIntensity, aDuration, aPromiseID);
}
void
VRSystemManagerOculus::StopVibrateHaptic(uint32_t aControllerIdx)
{
// mSession is available after VRDisplay is created
// at GetHMDs().
if (!mSession) {
return;
}
RefPtr<impl::VRControllerOculus> controller = mOculusController[aControllerIdx];
MOZ_ASSERT(controller);
controller->StopVibrateHaptic();
}
void

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

@ -103,15 +103,31 @@ public:
void SetIndexTrigger(float aValue);
float GetHandTrigger();
void SetHandTrigger(float aValue);
void VibrateHaptic(ovrSession aSession,
uint32_t aHapticIndex,
double aIntensity,
double aDuration,
uint32_t aPromiseID);
void StopVibrateHaptic();
protected:
virtual ~VRControllerOculus();
private:
void UpdateVibrateHaptic(ovrSession aSession,
uint32_t aHapticIndex,
double aIntensity,
double aDuration,
uint64_t aVibrateIndex,
uint32_t aPromiseID);
void VibrateHapticComplete(ovrSession aSession, uint32_t aPromiseID, bool aStop);
float mAxisMove[static_cast<uint32_t>(
OculusControllerAxisType::NumVRControllerAxisType)];
float mIndexTrigger;
float mHandTrigger;
nsCOMPtr<nsIThread> mVibrateThread;
Atomic<bool> mIsVibrateStopped;
};
} // namespace impl

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

@ -462,11 +462,11 @@ VRControllerOpenVR::UpdateVibrateHaptic(vr::IVRSystem* aVRSystem,
return;
}
double duration = (aIntensity == 0) ? 0 : aDuration;
const double duration = (aIntensity == 0) ? 0 : aDuration;
// We expect OpenVR to vibrate for 5 ms, but we found it only response the
// commend ~ 3.9 ms. For duration time longer than 3.9 ms, we separate them
// to a loop of 3.9 ms for make users feel that is a continuous events.
uint32_t microSec = (duration < 3.9 ? duration : 3.9) * 1000 * aIntensity;
const uint32_t microSec = (duration < 3.9 ? duration : 3.9) * 1000 * aIntensity;
aVRSystem->TriggerHapticPulse(GetTrackedIndex(),
aHapticIndex, microSec);

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

@ -1895,15 +1895,12 @@ InIRGenerator::tryAttachNativeIn(HandleId key, ValOperandId keyId,
if (!LookupPropertyPure(cx_, obj, key, &holder, &prop))
return false;
if (prop.isNonNativeProperty())
return false;
if (!IsCacheableGetPropReadSlotForIonOrCacheIR(obj, holder, prop))
if (!prop.isNativeProperty())
return false;
Maybe<ObjOperandId> holderId;
emitIdGuard(keyId, key);
EmitReadSlotGuard(writer, obj, holder, prop.maybeShape(), objId, &holderId);
EmitReadSlotGuard(writer, obj, holder, prop.shape(), objId, &holderId);
writer.loadBooleanResult(true);
writer.returnFromIC();

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

@ -6781,7 +6781,7 @@ struct JS_PUBLIC_API(PerformanceGroup) {
uint64_t refCount_;
};
using PerformanceGroupVector = mozilla::Vector<RefPtr<js::PerformanceGroup>, 0, SystemAllocPolicy>;
using PerformanceGroupVector = mozilla::Vector<RefPtr<js::PerformanceGroup>, 8, SystemAllocPolicy>;
/**
* Commit any Performance Monitoring data.

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

@ -20,6 +20,7 @@
#include "gc/Zone.h"
#include "vm/Runtime.h"
namespace js {
bool
@ -136,6 +137,9 @@ PerformanceMonitoring::start()
bool
PerformanceMonitoring::commit()
{
// Maximal initialization size, in elements for the vector of groups.
static const size_t MAX_GROUPS_INIT_CAPACITY = 1024;
#if !defined(MOZ_HAVE_RDTSC)
// The AutoStopwatch is only executed if `MOZ_HAVE_RDTSC`.
return false;
@ -152,13 +156,22 @@ PerformanceMonitoring::commit()
return true;
}
PerformanceGroupVector recentGroups;
recentGroups_.swap(recentGroups);
// The move operation is generally constant time, unless
// `recentGroups_.length()` is very small, in which case
// it's fast just because it's small.
PerformanceGroupVector recentGroups(Move(recentGroups_));
recentGroups_ = PerformanceGroupVector(); // Reconstruct after `Move`.
bool success = true;
if (stopwatchCommitCallback)
success = stopwatchCommitCallback(iteration_, recentGroups, stopwatchCommitClosure);
// Heuristic: we expect to have roughly the same number of groups as in
// the previous iteration.
const size_t capacity = std::min(recentGroups.capacity(), MAX_GROUPS_INIT_CAPACITY);
success = recentGroups_.reserve(capacity)
&& success;
// Reset immediately, to make sure that we're not hit by the end
// of a nested event loop (which would cause `commit` to be called
// twice in succession).
@ -227,7 +240,7 @@ AutoStopwatch::AutoStopwatch(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IM
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
JSCompartment* compartment = cx_->compartment();
if (compartment->scheduledForDestruction)
if (MOZ_UNLIKELY(compartment->scheduledForDestruction))
return;
JSRuntime* runtime = cx_->runtime();
@ -266,11 +279,11 @@ AutoStopwatch::~AutoStopwatch()
}
JSCompartment* compartment = cx_->compartment();
if (compartment->scheduledForDestruction)
if (MOZ_UNLIKELY(compartment->scheduledForDestruction))
return;
JSRuntime* runtime = cx_->runtime();
if (iteration_ != runtime->performanceMonitoring().iteration()) {
if (MOZ_UNLIKELY(iteration_ != runtime->performanceMonitoring().iteration())) {
// We have entered a nested event loop at some point.
// Any information we may have is obsolete.
return;

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

@ -98,7 +98,10 @@ ServoRestyleManager::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
/* static */ void
ServoRestyleManager::ClearServoDataFromSubtree(Element* aElement)
{
aElement->ClearServoData();
if (!aElement->HasServoData()) {
MOZ_ASSERT(!aElement->HasDirtyDescendantsForServo());
return;
}
StyleChildrenIterator it(aElement);
for (nsIContent* n = it.GetNextChild(); n; n = it.GetNextChild()) {
@ -107,6 +110,7 @@ ServoRestyleManager::ClearServoDataFromSubtree(Element* aElement)
}
}
aElement->ClearServoData();
aElement->UnsetHasDirtyDescendantsForServo();
}
@ -417,6 +421,8 @@ ServoRestyleManager::ProcessPendingRestyles()
IncrementRestyleGeneration();
}
FlushOverflowChangedTracker();
mInStyleRefresh = false;
styleSet->AssertTreeIsClean();

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

@ -8411,6 +8411,30 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
*aDestroyedFramesFor = aChild;
}
// We're destroying our frame(s). This normally happens either when the content
// is being removed from the DOM (in which case we'll drop all Servo data in
// UnbindFromTree), or when we're recreating frames (usually in response to
// having retrieved a ReconstructFrame change hint after restyling). In both of
// those cases, there are no pending restyles we need to worry about.
//
// However, there is also the (rare) DestroyFramesFor path, in which we tear
// down (and usually recreate) the frames for a subtree. In this case, leaving
// the style data on the elements is problematic for our invariants, because
// there might be pending restyles in the subtree. If we simply leave them as-is,
// the subsequent traversal when recreating frames will generate a bunch of bogus
// change hints to update frames that no longer exist.
//
// So the two obvious options are to (1) process all pending restyles and take all
// the change hints before destroying the frames, or (2) drop all the style data.
// We chose the latter, since that matches the performance characteristics of the
// old Gecko style system.
//
// That said, it's almost certainly possible to optimize this if it turns out to be
// hot. It's just not a priority at the moment.
if (aFlags == REMOVE_DESTROY_FRAMES && aChild->IsElement() && aChild->IsStyledByServo()) {
ServoRestyleManager::ClearServoDataFromSubtree(aChild->AsElement());
}
if (aChild->IsHTMLElement(nsGkAtoms::body) ||
(!aContainer && aChild->IsElement())) {
// This might be the element we propagated viewport scrollbar

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

@ -80,8 +80,8 @@ fails == 267459-1.html 267459-1.html
fails == 267459-2.html 267459-2.html
== 299065-1.html 299065-1.html
== 305643-1.html 305643-1.html
fails asserts-if(stylo,7) == 332655-1.html 332655-1.html # bug 1335314
fails asserts-if(stylo,7) == 332655-2.html 332655-2.html # bug 1335314
== 332655-1.html 332655-1.html
== 332655-2.html 332655-2.html
fails == 381279-1.html 381279-1.html
fails == 386339.html 386339.html
== 409375.html 409375.html

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

@ -369,23 +369,23 @@ fails == 315920-3f.html 315920-3f.html
fails == 315920-4.html 315920-4.html
fails == 315920-5.html 315920-5.html
fails == 315920-6.html 315920-6.html
fails == 315920-7a.html 315920-7a.html
fails == 315920-7b.html 315920-7b.html
fails == 315920-7c.html 315920-7c.html
fails == 315920-8a.html 315920-8a.html
fails == 315920-8b.html 315920-8b.html # bug 1349909
fails == 315920-9.html 315920-9.html
== 315920-7a.html 315920-7a.html
== 315920-7b.html 315920-7b.html
== 315920-7c.html 315920-7c.html
== 315920-8a.html 315920-8a.html
== 315920-8b.html 315920-8b.html # bug 1349909
== 315920-9.html 315920-9.html
== 315920-10.html 315920-10.html
fails == 315920-11.html 315920-11.html
fails == 315920-12a.html 315920-12a.html
fails == 315920-12b.html 315920-12b.html
fails == 315920-12c.html 315920-12c.html
fails == 315920-13a.html 315920-13a.html
fails == 315920-13b.html 315920-13b.html # bug 1349909
fails == 315920-14.html 315920-14.html
== 315920-11.html 315920-11.html
== 315920-12a.html 315920-12a.html
== 315920-12b.html 315920-12b.html
== 315920-12c.html 315920-12c.html
== 315920-13a.html 315920-13a.html
== 315920-13b.html 315920-13b.html # bug 1349909
== 315920-14.html 315920-14.html
== 315920-15.html 315920-15.html
fails == 315920-16.html 315920-16.html
fails == 315920-17.html 315920-17.html
== 315920-16.html 315920-16.html
== 315920-17.html 315920-17.html
== 315920-18a.html 315920-18a.html
== 315920-18b.html 315920-18b.html
== 315920-18c.html 315920-18c.html
@ -402,7 +402,7 @@ fails == 315920-22.html 315920-22.html
fails == 315920-23.html 315920-23.html
== 315920-24.html 315920-24.html
== 315920-25.html 315920-25.html
fails == 315920-26.html 315920-26.html
== 315920-26.html 315920-26.html
fails == 315920-27.html 315920-27.html
fails == 315920-28a.html 315920-28a.html
fails == 315920-28b.html 315920-28b.html
@ -481,14 +481,14 @@ fails == 348516-3.html 348516-3.html
== 348809-1d.html 348809-1d.html
== 348809-1e.html 348809-1e.html
== 348809-1f.html 348809-1f.html
fails == 348809-2a.html 348809-2a.html
fails == 348809-2b.html 348809-2b.html
fails == 348809-2c.html 348809-2c.html
fails == 348809-2d.html 348809-2d.html
fails == 348809-2e.html 348809-2e.html
fails == 348809-2f.html 348809-2f.html
fails == 348809-2g.html 348809-2g.html
fails == 348809-2h.html 348809-2h.html
== 348809-2a.html 348809-2a.html
== 348809-2b.html 348809-2b.html
== 348809-2c.html 348809-2c.html
== 348809-2d.html 348809-2d.html
== 348809-2e.html 348809-2e.html
== 348809-2f.html 348809-2f.html
== 348809-2g.html 348809-2g.html
== 348809-2h.html 348809-2h.html
fails == 349695-1a.html 349695-1a.html
fails == 349695-1b.html 349695-1b.html
# with CoreText rendering due to clipping of one subpixel-antialiasing pixel at end of text
@ -497,30 +497,30 @@ fails == 349695-1b.html 349695-1b.html
== 351641-1b.html 351641-1b.html
== 351641-2a.html 351641-2a.html
== 351641-2b.html 351641-2b.html
fails == 352980-1a.html 352980-1a.html
fails == 352980-1b.html 352980-1b.html
fails == 352980-1c.html 352980-1c.html
fails == 352980-1d.html 352980-1d.html
== 352980-1a.html 352980-1a.html
== 352980-1b.html 352980-1b.html
== 352980-1c.html 352980-1c.html
== 352980-1d.html 352980-1d.html
== 352980-1e.html 352980-1e.html
fails == 352980-1f.html 352980-1f.html
== 352980-1f.html 352980-1f.html
== 352980-1g.html 352980-1g.html
fails == 352980-1h.html 352980-1h.html
fails == 352980-1i.html 352980-1i.html
fails == 352980-1j.html 352980-1j.html
fails == 352980-1k.html 352980-1k.html
fails == 352980-1l.html 352980-1l.html
fails == 352980-2a.html 352980-2a.html
fails == 352980-2b.html 352980-2b.html
fails == 352980-2c.html 352980-2c.html
fails == 352980-2d.html 352980-2d.html
fails == 352980-2e.html 352980-2e.html
fails == 352980-2f.html 352980-2f.html
fails == 352980-3a.html 352980-3a.html
fails == 352980-3b.html 352980-3b.html
fails == 352980-3c.html 352980-3c.html
fails == 352980-3d.html 352980-3d.html
fails == 352980-3e.html 352980-3e.html
fails == 352980-3f.html 352980-3f.html
== 352980-1h.html 352980-1h.html
== 352980-1i.html 352980-1i.html
== 352980-1j.html 352980-1j.html
== 352980-1k.html 352980-1k.html
== 352980-1l.html 352980-1l.html
== 352980-2a.html 352980-2a.html
== 352980-2b.html 352980-2b.html
== 352980-2c.html 352980-2c.html
== 352980-2d.html 352980-2d.html
== 352980-2e.html 352980-2e.html
== 352980-2f.html 352980-2f.html
== 352980-3a.html 352980-3a.html
== 352980-3b.html 352980-3b.html
== 352980-3c.html 352980-3c.html
== 352980-3d.html 352980-3d.html
== 352980-3e.html 352980-3e.html
== 352980-3f.html 352980-3f.html
== 355548-1.xml 355548-1.xml
== 355548-2.xml 355548-2.xml
== 355548-3.xml 355548-3.xml
@ -1626,21 +1626,21 @@ fails == 608636-1.html 608636-1.html
== 608756-1b.html 608756-1b.html
== 608756-2.html 608756-2.html
== 609272-1.html 609272-1.html
fails == 613433-1.html 613433-1.html
fails == 613433-1.html 613433-1.html
fails == 613433-1.html 613433-1.html
fails == 613433-2.html 613433-2.html
fails == 613433-2.html 613433-2.html
fails == 613433-2.html 613433-2.html
fails == 613433-3.html 613433-3.html
fails == 613433-3.html 613433-3.html
fails == 613433-3.html 613433-3.html
== 613433-1.html 613433-1.html
== 613433-1.html 613433-1.html
== 613433-1.html 613433-1.html
== 613433-2.html 613433-2.html
== 613433-2.html 613433-2.html
== 613433-2.html 613433-2.html
== 613433-3.html 613433-3.html
== 613433-3.html 613433-3.html
== 613433-3.html 613433-3.html
== 614272-1.svg 614272-1.svg
fails HTTP(..) == 615121-1.html 615121-1.html
fails HTTP(..) == 615121-2.html 615121-2.html
fails == 617242-1.html 617242-1.html
fails == 618071.html 618071.html
fails == 619117-1.html 619117-1.html
== 619117-1.html 619117-1.html
fails HTTP(..) == 619511-1.html 619511-1.html
== 621253-1-externalFilter.html 621253-1-externalFilter.html
== 621253-1-internalFilter.html 621253-1-internalFilter.html
@ -1675,8 +1675,8 @@ fails == 645647-1.html 645647-1.html
== 645647-2.html 645647-2.html
fails == 645768-1.html 645768-1.html
== 650228-1.html 650228-1.html
fails needs-focus == 652301-1a.html 652301-1a.html
fails needs-focus == 652301-1b.html 652301-1b.html
needs-focus == 652301-1a.html 652301-1a.html
needs-focus == 652301-1b.html 652301-1b.html
fails == 652775-1.html 652775-1.html
fails == 653930-1.html 653930-1.html
fails HTTP(..) == 654057-1.html 654057-1.html
@ -1700,9 +1700,9 @@ fails == 670467-2.html 670467-2.html
== 691571-1.html 691571-1.html
== 696307-1.html 696307-1.html
== 696739-1.html 696739-1.html
needs-focus == 703186-1.html 703186-1.html
fails needs-focus == 703186-1.html 703186-1.html # Bug 1351724
needs-focus == 703186-2.html 703186-2.html
needs-focus == 703186-1.html 703186-1.html
fails needs-focus == 703186-1.html 703186-1.html # Bug 1351724
== 711359-1.html 711359-1.html
== 712849-1.html 712849-1.html
== 713856-static.html 713856-static.html
@ -1712,7 +1712,7 @@ needs-focus == 703186-1.html 703186-1.html
== 714519-2-as.html 714519-2-as.html
== 714519-2-q.html 714519-2-q.html
== 718521.html 718521.html
fails == 720987.html 720987.html
== 720987.html 720987.html
== 722888-1.html 722888-1.html
== 722923-1.html 722923-1.html
== 723484-1.html 723484-1.html
@ -1802,7 +1802,7 @@ fails == 942017.html 942017.html
fails == 942672-1.html 942672-1.html
== 953334-win32-clipping.html 953334-win32-clipping.html
fuzzy-if(skiaContent,1,5) == 956513-1.svg 956513-1.svg
fails == 944291-1.html 944291-1.html
== 944291-1.html 944291-1.html
fails == 950436-1.html 950436-1.html
== 957770-1.svg 957770-1.svg
fails == 960277-1.html 960277-1.html
@ -1838,7 +1838,7 @@ pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1.html
== 1022612-1.html 1022612-1.html
== 1024473-1.html 1024473-1.html
== 1025914-1.html 1025914-1.html
fails == 1042104-1.html 1042104-1.html
== 1042104-1.html 1042104-1.html
== 1043537-1.html 1043537-1.html
== 1044198-1.html 1044198-1.html
== 1049499-1.html 1049499-1.html
@ -1936,7 +1936,7 @@ fails == 1155828-1.html 1155828-1.html
== 1156129-1.html 1156129-1.html
pref(dom.use_xbl_scopes_for_remote_xul,true) HTTP(..) == 1157127-1.html 1157127-1.html
fails == 1169331-1.html 1169331-1.html
fails == 1174332-1.html 1174332-1.html
== 1174332-1.html 1174332-1.html
== 1179078-1.html 1179078-1.html
== 1179288-1.html 1179288-1.html
== 1190635-1.html 1190635-1.html

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

@ -1,14 +1,14 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
== button-valid.html button-valid.html
fails == button-invalid.html button-invalid.html
== button-invalid.html button-invalid.html
== button-disabled.html button-disabled.html
== button-dyn-disabled.html button-dyn-disabled.html
fails == button-dyn-not-disabled.html button-dyn-not-disabled.html
== button-dyn-not-disabled.html button-dyn-not-disabled.html
== button-button.html button-button.html
== button-reset.html button-reset.html
fails == button-type-invalid.html button-type-invalid.html
== button-type-invalid.html button-type-invalid.html
== button-type-barred.html button-type-barred.html
== button-disabled-fieldset-1.html button-disabled-fieldset-1.html
== button-disabled-fieldset-2.html button-disabled-fieldset-2.html
fails == button-fieldset-legend.html button-fieldset-legend.html
== button-fieldset-legend.html button-fieldset-legend.html
== button-novalidate.html button-novalidate.html

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

@ -4,7 +4,7 @@ fails == button.html button.html
fails == textarea.html textarea.html
fails == select.html select.html
== fieldset.html fieldset.html # Bug 1340696
fails == output.html output.html # Bug 1341739
== output.html output.html
fails == input-focus.html input-focus.html
fails needs-focus == button-focus.html button-focus.html
fails needs-focus == textarea-focus.html textarea-focus.html

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

@ -1,4 +1,4 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
== output-valid.html output-valid.html
fails == output-invalid.html output-invalid.html # Bug 1341739
== output-invalid.html output-invalid.html
== output-novalidate.html output-novalidate.html

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

@ -28,17 +28,17 @@ fails == block-invalidate.html block-invalidate.html
fails == max-height.html max-height.html
# Tests for block and inline orientation in combination with writing-mode
fails == meter-orient-vertical.html meter-orient-vertical.html
fails == meter-orient-horizontal.html meter-orient-horizontal.html
fails == meter-orient-block.html meter-orient-block.html
fails == meter-orient-inline.html meter-orient-inline.html
fails == meter-vlr.html meter-vlr.html
fails == meter-vlr-orient-block.html meter-vlr-orient-block.html
fails == meter-vlr-orient-inline.html meter-vlr-orient-inline.html
fails == meter-vlr-orient-horizontal.html meter-vlr-orient-horizontal.html
fails == meter-vlr-orient-vertical.html meter-vlr-orient-vertical.html
fails == meter-vrl.html meter-vrl.html
fails == meter-vrl-orient-block.html meter-vrl-orient-block.html
fails == meter-vrl-orient-inline.html meter-vrl-orient-inline.html
fails == meter-vrl-orient-horizontal.html meter-vrl-orient-horizontal.html
fails == meter-vrl-orient-vertical.html meter-vrl-orient-vertical.html
== meter-orient-vertical.html meter-orient-vertical.html
== meter-orient-horizontal.html meter-orient-horizontal.html
== meter-orient-block.html meter-orient-block.html
== meter-orient-inline.html meter-orient-inline.html
== meter-vlr.html meter-vlr.html
== meter-vlr-orient-block.html meter-vlr-orient-block.html
== meter-vlr-orient-inline.html meter-vlr-orient-inline.html
== meter-vlr-orient-horizontal.html meter-vlr-orient-horizontal.html
== meter-vlr-orient-vertical.html meter-vlr-orient-vertical.html
== meter-vrl.html meter-vrl.html
== meter-vrl-orient-block.html meter-vrl-orient-block.html
== meter-vrl-orient-inline.html meter-vrl-orient-inline.html
== meter-vrl-orient-horizontal.html meter-vrl-orient-horizontal.html
== meter-vrl-orient-vertical.html meter-vrl-orient-vertical.html

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

@ -48,7 +48,7 @@ fails == transform-floating-point-invalidation.html transform-floating-point-inv
fails == transform-floating-point-invalidation.html?reverse transform-floating-point-invalidation.html?reverse
fails == nudge-to-integer-invalidation.html nudge-to-integer-invalidation.html
fails == nudge-to-integer-invalidation.html?reverse nudge-to-integer-invalidation.html?reverse
fails == clipped-animated-transform-1.html clipped-animated-transform-1.html
== clipped-animated-transform-1.html clipped-animated-transform-1.html
fails == paintedlayer-recycling-1.html paintedlayer-recycling-1.html
fails == paintedlayer-recycling-2.html paintedlayer-recycling-2.html
fails pref(layers.single-tile.enabled,false) == paintedlayer-recycling-3.html paintedlayer-recycling-3.html

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

@ -110,4 +110,4 @@ fails == underline-select-1.html underline-select-1.html
fails == underline-select-2.html underline-select-2.html
fails == 1133392.html 1133392.html
== 1159729-offset-adjustment.html 1159729-offset-adjustment.html
fails == emphasis-style-dynamic.html emphasis-style-dynamic.html
== emphasis-style-dynamic.html emphasis-style-dynamic.html

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

@ -1,5 +1,5 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
fails == 723669.html 723669.html
== 723669.html 723669.html
== basic.xul basic.xul
random-if(Android) == basic-negcoord.xul basic-negcoord.xul

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

@ -241,11 +241,11 @@ fuzzy-if(stylo,251,160000) == css-values-3/vh-support-transform-translate.html c
== css-values-3/vh-zero-support.html css-values-3/vh-zero-support.html
skip-if(stylo) == css-values-3/vh_not_refreshing_on_chrome.html css-values-3/vh_not_refreshing_on_chrome.html # bug 1346829
skip-if(stylo) == css-values-3/vh_not_refreshing_on_chrome_iframe.html css-values-3/vh_not_refreshing_on_chrome_iframe.html # Why does this fail to load?
fails needs-focus == selectors-4/focus-within-001.html selectors-4/focus-within-001.html
fails needs-focus == selectors-4/focus-within-002.html selectors-4/focus-within-002.html
fails needs-focus == selectors-4/focus-within-003.html selectors-4/focus-within-003.html
fails needs-focus == selectors-4/focus-within-004.html selectors-4/focus-within-004.html
fails needs-focus == selectors-4/focus-within-005.html selectors-4/focus-within-005.html
needs-focus == selectors-4/focus-within-001.html selectors-4/focus-within-001.html
needs-focus == selectors-4/focus-within-002.html selectors-4/focus-within-002.html
needs-focus == selectors-4/focus-within-003.html selectors-4/focus-within-003.html
needs-focus == selectors-4/focus-within-004.html selectors-4/focus-within-004.html
needs-focus == selectors-4/focus-within-005.html selectors-4/focus-within-005.html
fails needs-focus == selectors-4/focus-within-006.html selectors-4/focus-within-006.html
needs-focus == selectors-4/focus-within-shadow-001.html selectors-4/focus-within-shadow-001.html
skip-if(stylo) pref(dom.webcomponents.enabled,true) needs-focus == selectors-4/focus-within-shadow-002.html selectors-4/focus-within-shadow-002.html # Bug 1292285

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

@ -1,7 +1,7 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
fails needs-focus == focus-within-1.html focus-within-1.html
needs-focus == focus-within-1.html focus-within-1.html
needs-focus == focus-within-2.html focus-within-2.html
fails needs-focus == focus-within-3.html focus-within-3.html
needs-focus == focus-within-3.html focus-within-3.html
== dir-style-01a.html dir-style-01a.html
fails == dir-style-01b.html dir-style-01b.html
== dir-style-02a.html dir-style-02a.html

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

@ -204,30 +204,12 @@ Gecko_ElementState(RawGeckoElementBorrowed aElement)
return aElement->StyleState().ServoValue();
}
bool
Gecko_IsLink(RawGeckoElementBorrowed aElement)
{
return nsCSSRuleProcessor::IsLink(aElement);
}
bool
Gecko_IsTextNode(RawGeckoNodeBorrowed aNode)
{
return aNode->NodeInfo()->NodeType() == nsIDOMNode::TEXT_NODE;
}
bool
Gecko_IsVisitedLink(RawGeckoElementBorrowed aElement)
{
return aElement->StyleState().HasState(NS_EVENT_STATE_VISITED);
}
bool
Gecko_IsUnvisitedLink(RawGeckoElementBorrowed aElement)
{
return aElement->StyleState().HasState(NS_EVENT_STATE_UNVISITED);
}
bool
Gecko_IsRootElement(RawGeckoElementBorrowed aElement)
{
@ -961,8 +943,7 @@ void
Gecko_InitializeImageCropRect(nsStyleImage* aImage)
{
MOZ_ASSERT(aImage);
nsStyleSides cropRect;
aImage->SetCropRect(MakeUnique<nsStyleSides>(cropRect));
aImage->SetCropRect(MakeUnique<nsStyleSides>());
}
void

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

@ -150,10 +150,7 @@ RawGeckoNodeBorrowedOrNull Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowed
// Selector Matching.
uint64_t Gecko_ElementState(RawGeckoElementBorrowed element);
bool Gecko_IsLink(RawGeckoElementBorrowed element);
bool Gecko_IsTextNode(RawGeckoNodeBorrowed node);
bool Gecko_IsVisitedLink(RawGeckoElementBorrowed element);
bool Gecko_IsUnvisitedLink(RawGeckoElementBorrowed element);
bool Gecko_IsRootElement(RawGeckoElementBorrowed element);
bool Gecko_MatchesElement(mozilla::CSSPseudoClassType type, RawGeckoElementBorrowed element);
nsIAtom* Gecko_LocalName(RawGeckoElementBorrowed element);

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

@ -61,7 +61,7 @@ to mochitest command.
* test_value_storage.html `frames` [30]
* Property parsing and computation:
* test_property_syntax_errors.html `animation` [404]
* test_value_storage.html `animation` [280]
* test_value_storage.html `animation` [91]
* test_any_dynamic.html: slow selector handling [3]
* test_bug635286.html: :-moz-any pseudo-class bugs [3]
* CSSOM support:
@ -93,7 +93,7 @@ to mochitest command.
* test_transitions_computed_value_combinations.html [145]
* test_transitions_dynamic_changes.html [10]
* test_transitions_step_functions.html [24]
* test_value_storage.html `transition` [776]
* test_value_storage.html `transition` [596]
* Events:
* test_animations_event_handler_attribute.html [10]
* test_animations_event_order.html [11]
@ -339,8 +339,8 @@ to mochitest command.
* Incorrect serialization
* border-radius and -moz-outline-radius shorthand servo/servo#15169
* test_priority_preservation.html `border-radius` [4]
* test_value_storage.html `border-radius:` [156]
* ... `-moz-outline-radius:` [76]
* test_value_storage.html `border-radius:` [92]
* ... `-moz-outline-radius:` [45]
* test_shorthand_property_getters.html `should condense to shortest possible` [6]
* transform property servo/servo#15194
* test_value_storage.html `'transform` [104]
@ -349,15 +349,12 @@ to mochitest command.
* test_specified_value_serialization.html `bug-721136` [27]
* test_units_angle.html [3]
* {background,mask}-position lacks comma for serialization servo/servo#15200
* test_value_storage.html `background-position` [63]
* test_shorthand_property_getters.html `background-position` [1]
* color value not canonicalized servo/servo#15397
* test_shorthand_property_getters.html `should condense to canonical case` [2]
* background-position invalid 3-value form **issue to be filed**
* test_shorthand_property_getters.html `should serialize to 4-value` [2]
* test_variables.html `--weird`: name of custom property is not escaped properly servo/servo#15399 [1]
* image-layer values should omit some of its parts when they are initial servo/servo#15951
* test_shorthand_property_getters.html `background` [2]
* :not(*) doesn't serialize properly servo/servo#16017
* test_selectors.html `:not()` [8]
* ... `:not(html|)` [1]
@ -371,8 +368,6 @@ to mochitest command.
* ::-moz-color-swatch bug 1348492
* test_selectors.html `::-moz-color-swatch` [1]
* Unsupported pseudo-classes
* :default ##easy##
* test_bug302186.html [24]
* :-moz-locale-dir
* test_selectors.html `:-moz-locale-dir` [15]
* :-moz-lwtheme-*
@ -392,9 +387,6 @@ to mochitest command.
* ... `0.766667px` [2]
* ... `105.333px` [2]
* test_value_storage.html `: var(--a)`: extra whitespace is added for shorthand with variables servo/servo#15295 [*]
* border-width computed wrong bug 1335990
* test_parse_rule.html `border-style` [4]
* test_initial_computation.html `0px", expected "3px` [48]
* Negative value should be rejected
* test_property_syntax_errors.html `transition-duration`: servo/servo#15343 [20]
* ... `perspective'`: servo/servo#15449 [20]
@ -425,7 +417,7 @@ to mochitest command.
* test_variable_serialization_computed.html [35]
* test_variables.html `custom property name` [2]
* test_css_supports.html: issues around @supports syntax servo/servo#15482 [8]
* test_author_specified_style.html: support serializing color as author specified bug 1348165 [33]
* test_author_specified_style.html: support serializing color as author specified bug 1348165 [27]
* browser_newtab_share_rule_processors.js: agent style sheet sharing [1]
* test_selectors.html `this_better_be_unvisited`: visited handling [2]

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

@ -15,9 +15,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 92456268,
"digest": "daf44b245cb258e105068c1befbd656039854c4a93e2aefe487bdb42650c32e63ee6f14c7a4ad5b3aa964a29f2814c8cb007b1d287e001c969a124f0bcf461e5",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 94615584,
"digest": "b2505fe26e71a0a0eea8abc338beb65e00b799922e6ac67024ab227cee18795bdf17f4b8f6ecddd288e59de5f84b20ad5f5afaee72daa0cb016a52000f73b7f9",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -48,9 +48,9 @@
"unpack": true
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 92456268,
"digest": "daf44b245cb258e105068c1befbd656039854c4a93e2aefe487bdb42650c32e63ee6f14c7a4ad5b3aa964a29f2814c8cb007b1d287e001c969a124f0bcf461e5",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 94615584,
"digest": "b2505fe26e71a0a0eea8abc338beb65e00b799922e6ac67024ab227cee18795bdf17f4b8f6ecddd288e59de5f84b20ad5f5afaee72daa0cb016a52000f73b7f9",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -73,9 +73,9 @@
"size": 51753660
},
{
"version": "rustc 1.15.1 (021bd294c 2017-02-08) repack",
"size": 92456268,
"digest": "daf44b245cb258e105068c1befbd656039854c4a93e2aefe487bdb42650c32e63ee6f14c7a4ad5b3aa964a29f2814c8cb007b1d287e001c969a124f0bcf461e5",
"version": "rustc 1.16.0 (30cf806ef 2017-03-10) repack",
"size": 94615584,
"digest": "b2505fe26e71a0a0eea8abc338beb65e00b799922e6ac67024ab227cee18795bdf17f4b8f6ecddd288e59de5f84b20ad5f5afaee72daa0cb016a52000f73b7f9",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -171,6 +171,7 @@ HttpChannelChild::HttpChannelChild()
, mCacheEntryAvailable(false)
, mCacheExpirationTime(nsICacheEntry::NO_EXPIRATION_TIME)
, mSendResumeAt(false)
, mDeletingChannelSent(false)
, mIPCOpen(false)
, mKeptAlive(false)
, mUnknownDecoderInvolved(false)
@ -3101,7 +3102,17 @@ HttpChannelChild::GetResponseSynthesized(bool* aSynthesized)
void
HttpChannelChild::TrySendDeletingChannel()
{
if (!mDeletingChannelSent.compareExchange(false, true)) {
// SendDeletingChannel is already sent.
return;
}
if (NS_IsMainThread()) {
if (NS_WARN_IF(!mIPCOpen)) {
// IPC actor is detroyed already, do not send more messages.
return;
}
Unused << PHttpChannelChild::SendDeletingChannel();
return;
}

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