зеркало из https://github.com/mozilla/gecko-dev.git
Merge backout of 153390d0f83b
This commit is contained in:
Коммит
055468711e
|
@ -1942,9 +1942,6 @@ CSSLoaderImpl::LoadChildSheet(nsICSSStyleSheet* aParentSheet,
|
||||||
// Houston, we have a loop, blow off this child and pretend this never
|
// Houston, we have a loop, blow off this child and pretend this never
|
||||||
// happened
|
// happened
|
||||||
LOG_ERROR((" @import cycle detected, dropping load"));
|
LOG_ERROR((" @import cycle detected, dropping load"));
|
||||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
||||||
printf("@import cycle detected, dropping load");
|
|
||||||
#endif
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
data = data->mParentData;
|
data = data->mParentData;
|
||||||
|
@ -2250,11 +2247,6 @@ CSSLoaderImpl::Stop()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
mPostedEvents.Clear();
|
mPostedEvents.Clear();
|
||||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
||||||
if (arr.Length() != 0) {
|
|
||||||
printf("nsCSSLoader::Stop: stopping %d loads\n", int(arr.Length()));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mDatasToNotifyOn += arr.Length();
|
mDatasToNotifyOn += arr.Length();
|
||||||
for (i = 0; i < arr.Length(); ++i) {
|
for (i = 0; i < arr.Length(); ++i) {
|
||||||
|
@ -2338,11 +2330,6 @@ CSSLoaderImpl::StopLoadingSheet(nsIURI* aURL)
|
||||||
}
|
}
|
||||||
mPostedEvents.Clear();
|
mPostedEvents.Clear();
|
||||||
|
|
||||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
||||||
if (arr.Length() != 0) {
|
|
||||||
printf("nsCSSLoader::StopLoadingSheet: stopping %d loads\n", int(arr.Length()));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
mDatasToNotifyOn += arr.Length();
|
mDatasToNotifyOn += arr.Length();
|
||||||
for (i = 0; i < arr.Length(); ++i) {
|
for (i = 0; i < arr.Length(); ++i) {
|
||||||
--mDatasToNotifyOn;
|
--mDatasToNotifyOn;
|
||||||
|
|
|
@ -3,8 +3,6 @@ const DEBUG_all_stub = false;
|
||||||
|
|
||||||
function handleRequest(request, response)
|
function handleRequest(request, response)
|
||||||
{
|
{
|
||||||
dump("ccd.sjs: handling request with query " + request.queryString + "\n");
|
|
||||||
|
|
||||||
// Decode the query string to know what test we're doing.
|
// Decode the query string to know what test we're doing.
|
||||||
|
|
||||||
// character 1: 'I' = text/css response, 'J' = text/html response
|
// character 1: 'I' = text/css response, 'J' = text/html response
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
function handleRequest(request, response)
|
function handleRequest(request, response)
|
||||||
{
|
{
|
||||||
dump("redirect.sjs: handling request with query " + request.queryString + "\n");
|
|
||||||
response.setStatusLine(request.httpVersion, 301, "Moved Permanently");
|
response.setStatusLine(request.httpVersion, 301, "Moved Permanently");
|
||||||
response.setHeader("Location", request.queryString, false);
|
response.setHeader("Location", request.queryString, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<iframe src="/server/debug?2" style="width: 100%; height: 30px"></iframe>
|
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h2> </h2>
|
<h2> </h2>
|
||||||
<ol><li>text/css<ol><li>same origin<ol><li>valid</li>
|
<ol><li>text/css<ol><li>same origin<ol><li>valid</li>
|
||||||
|
@ -82,46 +80,6 @@
|
||||||
/** Test for Bug 524223 **/
|
/** Test for Bug 524223 **/
|
||||||
function check_iframe(ifr) {
|
function check_iframe(ifr) {
|
||||||
var doc = ifr.contentDocument;
|
var doc = ifr.contentDocument;
|
||||||
|
|
||||||
// To debug bug 536603, check the imported style rules in the iframe.
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
|
|
||||||
var parentSheet = doc.getElementsByTagName("style")[1].sheet;
|
|
||||||
for (var idx = 0; idx < parentSheet.cssRules.length; ++idx) {
|
|
||||||
var rule = parentSheet.cssRules[idx];
|
|
||||||
var ch = rule.href.indexOf("ccd.sjs?");
|
|
||||||
var id = rule.href.substring(ch + 8).substring(0,4);
|
|
||||||
if (rule.styleSheet) {
|
|
||||||
var rl = rule.styleSheet.cssRules;
|
|
||||||
if (rl.length > 0) {
|
|
||||||
var lastRule = rl[rl.length - 1];
|
|
||||||
is(lastRule.selectorText, "#" + id,
|
|
||||||
"selector text for rule @import-ed at " + rule.href + " that specifies color " + lastRule.style.backgroundColor);
|
|
||||||
} else {
|
|
||||||
ok(true, "@import rule importing " + rule.href + " has no rules");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ok(true, "@import rule importing " + rule.href + " has no sheet");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var links = doc.getElementsByTagName("link");
|
|
||||||
for (idx = 0; idx < links.length; ++idx) {
|
|
||||||
var link = links[idx];
|
|
||||||
var ch = link.href.indexOf("ccd.sjs?");
|
|
||||||
var id = link.href.substring(ch + 8).substring(0,4);
|
|
||||||
if (link.sheet) {
|
|
||||||
var rl = link.sheet.cssRules;
|
|
||||||
if (rl.length > 0) {
|
|
||||||
var lastRule = rl[rl.length - 1];
|
|
||||||
is(lastRule.selectorText, "#" + id,
|
|
||||||
"selector text for rule <link>ed at " + link.href + " that specifies color " + lastRule.style.backgroundColor);
|
|
||||||
} else {
|
|
||||||
ok(true, "<link>ed rule at " + link.href + " has no rules");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ok(true, "<link>ed rule at " + link.href + " has no sheet");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var cases = doc.getElementsByTagName("p");
|
var cases = doc.getElementsByTagName("p");
|
||||||
for (var i = 0; i < cases.length; i++) {
|
for (var i = 0; i < cases.length; i++) {
|
||||||
var color = doc.defaultView.getComputedStyle(cases[i], "")
|
var color = doc.defaultView.getComputedStyle(cases[i], "")
|
||||||
|
@ -133,18 +91,13 @@ function check_iframe(ifr) {
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
check_iframe(document.getElementById("quirks"));
|
// The quirks-mode tests are inexplicably failing intermittently
|
||||||
check_iframe(document.getElementById("standards"));
|
// on Mac (bug 536603), so disable them for now.
|
||||||
setTimeout(function() {
|
if (navigator.platform.substring(0,3) != "Mac")
|
||||||
check_iframe(document.getElementById("quirks"));
|
check_iframe(document.getElementById("quirks"));
|
||||||
check_iframe(document.getElementById("standards"));
|
check_iframe(document.getElementById("standards"));
|
||||||
document.getElementById("debugOff").
|
SimpleTest.finish();
|
||||||
setAttribute("src", "/server/debug?0");
|
|
||||||
SimpleTest.finish();
|
|
||||||
}, 5000);
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<iframe id="debugOff" style="width: 100%; height: 30px"></iframe>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -57,9 +57,6 @@ const PR_UINT32_MAX = Math.pow(2, 32) - 1;
|
||||||
/** True if debugging output is enabled, false otherwise. */
|
/** True if debugging output is enabled, false otherwise. */
|
||||||
var DEBUG = false; // non-const *only* so tweakable in server tests
|
var DEBUG = false; // non-const *only* so tweakable in server tests
|
||||||
|
|
||||||
/** True if debugging output should be timestamped. */
|
|
||||||
var DEBUG_TIMESTAMP = false; // non-const so tweakable in server tests
|
|
||||||
|
|
||||||
var gGlobalObject = this;
|
var gGlobalObject = this;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,7 +75,7 @@ function NS_ASSERT(cond, msg)
|
||||||
|
|
||||||
var stack = new Error().stack.split(/\n/);
|
var stack = new Error().stack.split(/\n/);
|
||||||
dumpn(stack.map(function(val) { return "###!!! " + val; }).join("\n"));
|
dumpn(stack.map(function(val) { return "###!!! " + val; }).join("\n"));
|
||||||
|
|
||||||
throw Cr.NS_ERROR_ABORT;
|
throw Cr.NS_ERROR_ABORT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,26 +166,10 @@ const SJS_TYPE = "sjs";
|
||||||
|
|
||||||
|
|
||||||
/** dump(str) with a trailing "\n" -- only outputs if DEBUG */
|
/** dump(str) with a trailing "\n" -- only outputs if DEBUG */
|
||||||
var first_stamp = null;
|
|
||||||
function dumpn(str)
|
function dumpn(str)
|
||||||
{
|
{
|
||||||
if (DEBUG) {
|
if (DEBUG)
|
||||||
var prefix = "|HTTPD|";
|
dump(str + "\n");
|
||||||
if (DEBUG_TIMESTAMP) {
|
|
||||||
if (first_stamp === null) {
|
|
||||||
first_stamp = new Date();
|
|
||||||
}
|
|
||||||
var elapsed = (new Date() - first_stamp)/1000; // in decimal seconds
|
|
||||||
var min = Math.floor(elapsed/60);
|
|
||||||
var sec = elapsed - 60*min;
|
|
||||||
|
|
||||||
if (sec < 10)
|
|
||||||
prefix += min + ":0" + sec.toFixed(3) + " ";
|
|
||||||
else
|
|
||||||
prefix += min + ":" + sec.toFixed(3) + " ";
|
|
||||||
}
|
|
||||||
dump(prefix + str + "\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Dumps the current JS stack if DEBUG. */
|
/** Dumps the current JS stack if DEBUG. */
|
||||||
|
|
|
@ -198,7 +198,6 @@ function createMochitestServer(serverBasePath)
|
||||||
|
|
||||||
server.registerDirectory("/", serverBasePath);
|
server.registerDirectory("/", serverBasePath);
|
||||||
server.registerPathHandler("/server/shutdown", serverShutdown);
|
server.registerPathHandler("/server/shutdown", serverShutdown);
|
||||||
server.registerPathHandler("/server/debug", serverDebug);
|
|
||||||
server.registerContentType("sjs", "sjs"); // .sjs == CGI-like functionality
|
server.registerContentType("sjs", "sjs"); // .sjs == CGI-like functionality
|
||||||
server.registerContentType("jar", "application/x-jar");
|
server.registerContentType("jar", "application/x-jar");
|
||||||
server.registerContentType("ogg", "application/ogg");
|
server.registerContentType("ogg", "application/ogg");
|
||||||
|
@ -298,36 +297,6 @@ function serverShutdown(metadata, response)
|
||||||
server.stop(serverStopped);
|
server.stop(serverStopped);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /server/debug?[012]
|
|
||||||
function serverDebug(metadata, response)
|
|
||||||
{
|
|
||||||
var mode;
|
|
||||||
if (metadata.queryString.length != 1) {
|
|
||||||
throw HTTP_400;
|
|
||||||
} else if (metadata.queryString[0] == '0') {
|
|
||||||
// do this now so it gets logged with the old mode
|
|
||||||
dumpn("Server debug logs disabled.");
|
|
||||||
DEBUG = false;
|
|
||||||
DEBUG_TIMESTAMP = false;
|
|
||||||
mode = "disabled";
|
|
||||||
} else if (metadata.queryString[0] == '1') {
|
|
||||||
DEBUG = true;
|
|
||||||
DEBUG_TIMESTAMP = false;
|
|
||||||
mode = "enabled";
|
|
||||||
} else if (metadata.queryString[0] == '2') {
|
|
||||||
DEBUG = true;
|
|
||||||
DEBUG_TIMESTAMP = true;
|
|
||||||
mode = "enabled, with timestamps";
|
|
||||||
} else {
|
|
||||||
throw HTTP_400;
|
|
||||||
}
|
|
||||||
response.setStatusLine("1.1", 200, "OK");
|
|
||||||
response.setHeader("Content-type", "text/plain", false);
|
|
||||||
var body = "Server debug logs " + mode + ".";
|
|
||||||
response.bodyOutputStream.write(body, body.length);
|
|
||||||
dumpn(body);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// DIRECTORY LISTINGS
|
// DIRECTORY LISTINGS
|
||||||
//
|
//
|
||||||
|
|
Загрузка…
Ссылка в новой задаче