Backed out changesets f4fa8c49ebc6 and 78e2ba8842d4 (bug 1184387) for browser_parsable_css.js failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-08-05 14:39:28 -04:00
parent 1af9b51140
commit d8f92ebda6
2 changed files with 14 additions and 25 deletions

View File

@ -55,15 +55,6 @@ function ignoredError(aErrorObject) {
return false; return false;
} }
function once(target, name) {
return new Promise((resolve, reject) => {
target.addEventListener(name, function() {
target.removeEventListener(name, f);
resolve();
});
});
}
add_task(function checkAllTheCSS() { add_task(function checkAllTheCSS() {
let appDir = Services.dirsvc.get("XCurProcD", Ci.nsIFile); let appDir = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
// This asynchronously produces a list of URLs (sadly, mostly sync on our // This asynchronously produces a list of URLs (sadly, mostly sync on our
@ -71,21 +62,13 @@ add_task(function checkAllTheCSS() {
// our zipreader APIs are all sync) // our zipreader APIs are all sync)
let uris = yield generateURIsFromDirTree(appDir, ".css"); let uris = yield generateURIsFromDirTree(appDir, ".css");
// Create a clean iframe to load all the files into. This needs to live at a // Create a clean iframe to load all the files into:
// file or jar URI (depending on whether we're using a packaged build or not) let hiddenWin = Services.appShell.hiddenDOMWindow;
// so that it's allowed to load other same-scheme URIs (i.e. the browser css). let iframe = hiddenWin.document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
let resHandler = Services.io.getProtocolHandler("resource") hiddenWin.document.documentElement.appendChild(iframe);
.QueryInterface(Ci.nsISubstitutingProtocolHandler);
let resURI = Services.io.newURI('resource://testing-common/resource_test_file.html', null, null);
let testFile = resHandler.resolveURI(resURI);
let windowless = Services.appShell.createWindowlessBrowser();
let iframe = windowless.document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
windowless.document.documentElement.appendChild(iframe);
let iframeLoaded = once(iframe, 'load');
iframe.contentWindow.location = testFile;
yield iframeLoaded;
let doc = iframe.contentWindow.document; let doc = iframe.contentWindow.document;
// Listen for errors caused by the CSS: // Listen for errors caused by the CSS:
let errorListener = { let errorListener = {
observe: function(aMessage) { observe: function(aMessage) {

View File

@ -843,12 +843,18 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
} }
} }
// Allow chrome:// // resource: and chrome: are equivalent, securitywise
if (sourceScheme.EqualsLiteral("chrome")) { // That's bogus!! Fix this. But watch out for
// the view-source stylesheet?
bool sourceIsChrome;
rv = NS_URIChainHasFlags(sourceURI,
nsIProtocolHandler::URI_IS_UI_RESOURCE,
&sourceIsChrome);
NS_ENSURE_SUCCESS(rv, rv);
if (sourceIsChrome) {
return NS_OK; return NS_OK;
} }
// Nothing else.
if (reportErrors) { if (reportErrors) {
ReportError(nullptr, errorTag, sourceURI, aTargetURI); ReportError(nullptr, errorTag, sourceURI, aTargetURI);
} }