From d61f0dc5d6ef5a1dae7e24b8f3a88a7eb4e94743 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 31 Jan 2012 13:18:09 +0000 Subject: [PATCH] Bug 722322 - Have the "1" and "2" keys switch between images in reftest-analyzer.xhtml. r=ehsan. --- layout/tools/reftest/reftest-analyzer.xhtml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/layout/tools/reftest/reftest-analyzer.xhtml b/layout/tools/reftest/reftest-analyzer.xhtml index b6793ef23b26..29b138c666ab 100644 --- a/layout/tools/reftest/reftest-analyzer.xhtml +++ b/layout/tools/reftest/reftest-analyzer.xhtml @@ -137,6 +137,7 @@ function load() { ID("logentry").value = params.log; log_pasted(); } + window.addEventListener('keypress', maybe_load_image, false); } function build_mag() { @@ -374,6 +375,19 @@ function show_image(i) { } } +function maybe_load_image(event) { + switch (event.charCode) { + case 49: // "1" key + document.getElementById("radio1").checked = true; + show_image(1); + break; + case 50: // "2" key + document.getElementById("radio2").checked = true; + show_image(2); + break; + } +} + function show_differences(cb) { ID("diffrect").style.display = cb.checked ? "" : "none"; } @@ -513,8 +527,8 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {