зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset a7b0c6ddd812 (bug 863246)
This commit is contained in:
Родитель
97b2bded93
Коммит
a8f25b8f67
|
@ -173,6 +173,7 @@ var whitelist = [
|
|||
{file: "resource://gre/modules/accessibility/AccessFu.jsm"},
|
||||
// Bug 1351637
|
||||
{file: "resource://gre/modules/sdk/bootstrap.js"},
|
||||
|
||||
];
|
||||
|
||||
whitelist = new Set(whitelist.filter(item =>
|
||||
|
@ -474,8 +475,7 @@ function findChromeUrlsFromArray(array, prefix) {
|
|||
|
||||
// Only keep strings that look like real chrome or resource urls.
|
||||
if (/chrome:\/\/[a-zA-Z09 -]+\/(content|skin|locale)\//.test(string) ||
|
||||
/resource:\/\/gre.*\.[a-z]+/.test(string) ||
|
||||
string.startsWith("resource://content-accessible/"))
|
||||
/resource:\/\/gre.*\.[a-z]+/.test(string))
|
||||
gReferencesFromCode.add(string);
|
||||
}
|
||||
}
|
||||
|
@ -537,8 +537,6 @@ add_task(async function checkAllTheFiles() {
|
|||
let devtoolsPrefixes = ["chrome://webide/",
|
||||
"chrome://devtools",
|
||||
"resource://devtools/",
|
||||
"resource://devtools-client-jsonview/",
|
||||
"resource://devtools-client-shared/",
|
||||
"resource://app/modules/devtools",
|
||||
"resource://gre/modules/devtools"];
|
||||
let chromeFiles = [];
|
||||
|
|
|
@ -17,7 +17,7 @@ let whitelist = [
|
|||
{sourceName: /devtools\/client\/debugger\/new\/debugger.css/i,
|
||||
isFromDevTools: true},
|
||||
// Reps uses cross-browser CSS.
|
||||
{sourceName: /devtools-client-shared\/components\/reps\/reps.css/i,
|
||||
{sourceName: /devtools\/client\/shared\/components\/reps\/reps.css/i,
|
||||
isFromDevTools: true},
|
||||
// PDFjs is futureproofing its pseudoselectors, and those rules are dropped.
|
||||
{sourceName: /web\/viewer\.css$/i,
|
||||
|
@ -288,49 +288,41 @@ add_task(async function checkAllTheCSS() {
|
|||
// Wait for all manifest to be parsed
|
||||
await Promise.all(manifestPromises);
|
||||
|
||||
// We build a list of promises that get resolved when their respective
|
||||
// files have loaded and produced no errors.
|
||||
let allPromises = [];
|
||||
|
||||
// filter out either the devtools paths or the non-devtools paths:
|
||||
let isDevtools = SimpleTest.harnessParameters.subsuite == "devtools";
|
||||
let devtoolsPathBits = ["webide", "devtools"];
|
||||
uris = uris.filter(uri => isDevtools == devtoolsPathBits.some(path => uri.spec.includes(path)));
|
||||
|
||||
let loadCSS = chromeUri => new Promise(resolve => {
|
||||
let linkEl, onLoad, onError;
|
||||
onLoad = e => {
|
||||
processCSSRules(linkEl.sheet);
|
||||
resolve();
|
||||
linkEl.removeEventListener("load", onLoad);
|
||||
linkEl.removeEventListener("error", onError);
|
||||
};
|
||||
onError = e => {
|
||||
ok(false, "Loading " + linkEl.getAttribute("href") + " threw an error!");
|
||||
resolve();
|
||||
linkEl.removeEventListener("load", onLoad);
|
||||
linkEl.removeEventListener("error", onError);
|
||||
};
|
||||
linkEl = doc.createElement("link");
|
||||
for (let uri of uris) {
|
||||
let linkEl = doc.createElement("link");
|
||||
linkEl.setAttribute("rel", "stylesheet");
|
||||
linkEl.setAttribute("type", "text/css");
|
||||
linkEl.addEventListener("load", onLoad);
|
||||
linkEl.addEventListener("error", onError);
|
||||
linkEl.setAttribute("href", chromeUri + kPathSuffix);
|
||||
allPromises.push(new Promise(resolve => {
|
||||
let onLoad = (e) => {
|
||||
processCSSRules(linkEl.sheet);
|
||||
resolve();
|
||||
linkEl.removeEventListener("load", onLoad);
|
||||
linkEl.removeEventListener("error", onError);
|
||||
};
|
||||
let onError = (e) => {
|
||||
ok(false, "Loading " + linkEl.getAttribute("href") + " threw an error!");
|
||||
resolve();
|
||||
linkEl.removeEventListener("load", onLoad);
|
||||
linkEl.removeEventListener("error", onError);
|
||||
};
|
||||
linkEl.addEventListener("load", onLoad);
|
||||
linkEl.addEventListener("error", onError);
|
||||
linkEl.setAttribute("type", "text/css");
|
||||
let chromeUri = convertToCodeURI(uri.spec);
|
||||
linkEl.setAttribute("href", chromeUri + kPathSuffix);
|
||||
}));
|
||||
doc.head.appendChild(linkEl);
|
||||
});
|
||||
|
||||
// We build a list of promises that get resolved when their respective
|
||||
// files have loaded and produced no errors.
|
||||
const kInContentCommonCSS = "chrome://global/skin/in-content/common.css";
|
||||
let allPromises = uris.map((uri) => convertToCodeURI(uri.spec))
|
||||
.filter((uri) => uri !== kInContentCommonCSS);
|
||||
|
||||
// Make sure chrome://global/skin/in-content/common.css is loaded before other
|
||||
// stylesheets in order to guarantee the --in-content variables can be
|
||||
// correctly referenced.
|
||||
if (allPromises.length !== uris.length) {
|
||||
await loadCSS(kInContentCommonCSS);
|
||||
}
|
||||
|
||||
// Wait for all the files to have actually loaded:
|
||||
allPromises = allPromises.map(loadCSS);
|
||||
await Promise.all(allPromises);
|
||||
|
||||
// Check if all the files referenced from CSS actually exist.
|
||||
|
|
|
@ -100,12 +100,7 @@ function loadImage(uri, expect, callback) {
|
|||
}
|
||||
|
||||
// Start off the script src test, and have it start the img tests when complete.
|
||||
// Temporarily allow content to access all resource:// URIs.
|
||||
SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["security.all_resource_uri_content_accessible", true]
|
||||
]
|
||||
}, () => testScriptSrc(runImgTest));
|
||||
testScriptSrc(runImgTest);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -15,8 +15,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1290230
|
|||
"use strict";
|
||||
var exports = {}
|
||||
</script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="resource://devtools/shared/platform/content/clipboard.js"></script>
|
||||
|
||||
</head>
|
||||
<body onload="pre_do_tests()">
|
||||
<body onload="do_tests()">
|
||||
<script type="application/javascript">
|
||||
"use strict";
|
||||
|
||||
|
@ -27,25 +31,6 @@ function doCopy(e) {
|
|||
copyString(RESULT);
|
||||
}
|
||||
|
||||
async function pre_do_tests() {
|
||||
// Temporarily allow content to access all resource:// URIs.
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["security.all_resource_uri_content_accessible", true]
|
||||
]
|
||||
});
|
||||
|
||||
// Load script.
|
||||
await (() => new Promise((resolve) => {
|
||||
var script = document.createElement("script");
|
||||
script.onload = resolve;
|
||||
script.src = "resource://devtools/shared/platform/content/clipboard.js";
|
||||
document.head.appendChild(script);
|
||||
}))();
|
||||
|
||||
do_tests();
|
||||
}
|
||||
|
||||
function do_tests() {
|
||||
let elt = document.querySelector("#key");
|
||||
elt.addEventListener("keydown", doCopy);
|
||||
|
|
|
@ -19,11 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
|
||||
//Cycle through 4 different preference settings.
|
||||
function changePrefs(callback) {
|
||||
let newPrefs = [
|
||||
["security.all_resource_uri_content_accessible", true], // Temporarily allow content to access all resource:// URIs.
|
||||
["security.mixed_content.block_display_content", settings[counter][0]],
|
||||
["security.mixed_content.block_active_content", settings[counter][1]]
|
||||
];
|
||||
let newPrefs = [["security.mixed_content.block_display_content", settings[counter][0]],
|
||||
["security.mixed_content.block_active_content", settings[counter][1]]];
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set": newPrefs}, function () {
|
||||
blockDisplay = SpecialPowers.getBoolPref("security.mixed_content.block_display_content");
|
||||
|
|
Загрузка…
Ссылка в новой задаче