From 4401f7c29f040c38f14f5b5b2f05ce7cd39e1622 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 18 Jun 2010 23:51:45 +1200 Subject: [PATCH] Backed out changeset 5a07f228795b --- .../reftest-sanity/corners-1-ref.html | 6 --- layout/reftests/reftest-sanity/corners-1.html | 6 --- .../reftest-sanity/corners-2-ref.html | 6 --- layout/reftests/reftest-sanity/corners-2.html | 6 --- .../reftest-sanity/corners-3-ref.html | 6 --- layout/reftests/reftest-sanity/corners-3.html | 6 --- .../reftest-sanity/corners-4-ref.html | 6 --- layout/reftests/reftest-sanity/corners-4.html | 6 --- layout/reftests/reftest-sanity/reftest.list | 6 --- layout/tools/reftest/reftest.js | 53 ++++--------------- 10 files changed, 10 insertions(+), 97 deletions(-) delete mode 100644 layout/reftests/reftest-sanity/corners-1-ref.html delete mode 100644 layout/reftests/reftest-sanity/corners-1.html delete mode 100644 layout/reftests/reftest-sanity/corners-2-ref.html delete mode 100644 layout/reftests/reftest-sanity/corners-2.html delete mode 100644 layout/reftests/reftest-sanity/corners-3-ref.html delete mode 100644 layout/reftests/reftest-sanity/corners-3.html delete mode 100644 layout/reftests/reftest-sanity/corners-4-ref.html delete mode 100644 layout/reftests/reftest-sanity/corners-4.html diff --git a/layout/reftests/reftest-sanity/corners-1-ref.html b/layout/reftests/reftest-sanity/corners-1-ref.html deleted file mode 100644 index 3a3f5501f940..000000000000 --- a/layout/reftests/reftest-sanity/corners-1-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-1.html b/layout/reftests/reftest-sanity/corners-1.html deleted file mode 100644 index d332c0fbb1fd..000000000000 --- a/layout/reftests/reftest-sanity/corners-1.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-2-ref.html b/layout/reftests/reftest-sanity/corners-2-ref.html deleted file mode 100644 index f4908864ce43..000000000000 --- a/layout/reftests/reftest-sanity/corners-2-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-2.html b/layout/reftests/reftest-sanity/corners-2.html deleted file mode 100644 index 71e9f47fdeb0..000000000000 --- a/layout/reftests/reftest-sanity/corners-2.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-3-ref.html b/layout/reftests/reftest-sanity/corners-3-ref.html deleted file mode 100644 index 7a81d394ca56..000000000000 --- a/layout/reftests/reftest-sanity/corners-3-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-3.html b/layout/reftests/reftest-sanity/corners-3.html deleted file mode 100644 index 368348f2e949..000000000000 --- a/layout/reftests/reftest-sanity/corners-3.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-4-ref.html b/layout/reftests/reftest-sanity/corners-4-ref.html deleted file mode 100644 index a0bee5429039..000000000000 --- a/layout/reftests/reftest-sanity/corners-4-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/corners-4.html b/layout/reftests/reftest-sanity/corners-4.html deleted file mode 100644 index 4fe1db731234..000000000000 --- a/layout/reftests/reftest-sanity/corners-4.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- - diff --git a/layout/reftests/reftest-sanity/reftest.list b/layout/reftests/reftest-sanity/reftest.list index e207c099a465..7a806f49b839 100644 --- a/layout/reftests/reftest-sanity/reftest.list +++ b/layout/reftests/reftest-sanity/reftest.list @@ -64,9 +64,3 @@ include scripttests.list # test url-prefix include urlprefixtests.list - -# test that all corners are visible -!= corners-1.html corners-1-ref.html -!= corners-2.html corners-2-ref.html -!= corners-3.html corners-3-ref.html -!= corners-4.html corners-4-ref.html diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index e469fd7d2cb8..a16bc8bfd077 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -109,8 +109,6 @@ var gSlowestTestTime = 0; var gSlowestTestURL; var gClearingForAssertionCheck = false; -var gDrawWindowFlags; - const TYPE_REFTEST_EQUAL = '=='; const TYPE_REFTEST_NOTEQUAL = '!='; const TYPE_LOAD = 'load'; // test without a reference (just test that it does @@ -933,42 +931,8 @@ function UpdateCanvasCache(url, canvas) } } -// Compute drawWindow flags lazily so the window is set up and can be -// measured accurately -function DoDrawWindow(ctx, win, x, y, w, h) -{ - if (typeof gDrawWindowFlags == "undefined") { - gDrawWindowFlags = ctx.DRAWWINDOW_DRAW_CARET | - ctx.DRAWWINDOW_DRAW_VIEW; - var flags = "DRAWWINDOW_DRAW_CARET | DRAWWINDOW_DRAW_VIEW"; - var win = gBrowser.contentWindow; - if (win.innerWidth == gCurrentCanvas.width && - win.innerHeight == gCurrentCanvas.height) { - // We can use the window's retained layers - // because the window is big enough to display the entire reftest - gDrawWindowFlags |= ctx.DRAWWINDOW_USE_WIDGET_LAYERS; - flags += " | DRAWWINDOW_USE_WIDGET_LAYERS"; - } - dump("REFTEST INFO | drawWindow flags = " + flags + "\n"); - } - - var scrollX = 0; - var scrollY = 0; - if (!(gDrawWindowFlags & ctx.DRAWWINDOW_DRAW_VIEW)) { - scrollX = win.scrollX; - scrollY = win.scrollY; - } - ctx.drawWindow(win, scrollX + x, scrollY + y, w, h, "rgb(255,255,255)", - gDrawWindowFlags); -} - function InitCurrentCanvasWithSnapshot() { - if (gURLs[0].type == TYPE_LOAD || gURLs[0].type == TYPE_SCRIPT) { - // We don't want to snapshot this kind of test - return; - } - gCurrentCanvas = AllocateCanvas(); /* XXX This needs to be rgb(255,255,255) because otherwise we get @@ -982,9 +946,12 @@ function InitCurrentCanvasWithSnapshot() // window, so scale the drawing to show the zoom (making each canvas pixel be one // device pixel instead) ctx.scale(scale, scale); - DoDrawWindow(ctx, win, 0, 0, - Math.ceil(gCurrentCanvas.width / scale), - Math.ceil(gCurrentCanvas.height / scale)); + ctx.drawWindow(win, win.scrollX, win.scrollY, + Math.ceil(gCurrentCanvas.width / scale), + Math.ceil(gCurrentCanvas.height / scale), + "rgb(255,255,255)", + ctx.DRAWWINDOW_DRAW_CARET | + ctx.DRAWWINDOW_USE_WIDGET_LAYERS); ctx.restore(); } @@ -995,9 +962,6 @@ function roundTo(x, fraction) function UpdateCurrentCanvasForEvent(event) { - if (!gCurrentCanvas) - return; - var win = gBrowser.contentWindow; var ctx = gCurrentCanvas.getContext("2d"); var scale = gBrowser.markupDocumentViewer.fullZoom; @@ -1014,7 +978,10 @@ function UpdateCurrentCanvasForEvent(event) ctx.save(); ctx.scale(scale, scale); ctx.translate(left, top); - DoDrawWindow(ctx, win, left, top, right - left, bottom - top); + ctx.drawWindow(win, left + win.scrollX, top + win.scrollY, + right - left, bottom - top, + "rgb(255,255,255)", + ctx.DRAWWINDOW_DRAW_CARET); ctx.restore(); } }