From af2979daba4eefa7214d2de84ef2635cacd849ed Mon Sep 17 00:00:00 2001 From: "jwalden%mit.edu" Date: Thu, 20 Dec 2007 23:49:00 +0000 Subject: [PATCH] Bug 409293 - Support HTML targets on reftests, e.g. to allow acid2.html#top as the test or the reference. r=dbaron, a=testonlychange git-svn-id: svn://10.0.0.236/trunk@241871 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/tools/reftest/README.txt | 7 ++++--- mozilla/layout/tools/reftest/reftest.js | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/tools/reftest/README.txt b/mozilla/layout/tools/reftest/README.txt index ee1880bf79c..d688fdd04a5 100644 --- a/mozilla/layout/tools/reftest/README.txt +++ b/mozilla/layout/tools/reftest/README.txt @@ -33,9 +33,10 @@ running tests at any time to see whether they still pass. Manifest Format =============== -The test manifest format is a plain text file. The "#" makes the -remainder of a line a comment. Each non-blank line (after removal of -comments) must be one of the following: +The test manifest format is a plain text file. A line starting with a +"#" is a comment. Lines may be commented using whitespace followed by +a "#" and the comment. Each non-blank line (after removal of comments) +must be one of the following: 1. Inclusion of another manifest diff --git a/mozilla/layout/tools/reftest/reftest.js b/mozilla/layout/tools/reftest/reftest.js index aa935834fee..aadb2d4d82a 100644 --- a/mozilla/layout/tools/reftest/reftest.js +++ b/mozilla/layout/tools/reftest/reftest.js @@ -145,9 +145,11 @@ function ReadManifest(aURL) var more = lis.readLine(line); ++lineNo; var str = line.value; - str = /^[^#]*/.exec(str)[0]; // strip everything after "#" - if (!str) + if (str.charAt(0) == "#") continue; // entire line was a comment + var i = str.search(/\s+#/); + if (i >= 0) + str = str.substring(0, i); // strip leading and trailing whitespace str = str.replace(/^\s*/, '').replace(/\s*$/, ''); if (!str || str == "") @@ -386,7 +388,8 @@ function DocumentLoaded() /* XXX This needs to be rgb(255,255,255) because otherwise we get * black bars at the bottom of every test that are different size * for the first test and the rest (scrollbar-related??) */ - canvas.getContext("2d").drawWindow(gBrowser.contentWindow, 0, 0, + var win = gBrowser.contentWindow; + canvas.getContext("2d").drawWindow(win, win.scrollX, win.scrollY, canvas.width, canvas.height, "rgb(255,255,255)"); switch (gState) {