Commit f8386d1d authored by bokan's avatar bokan Committed by Commit bot

Remove window.moveTo calls from picker-common.js

These moveTo calls appear to be unneeded and they don't work on the main window
anyway. Due to the way that RenderWidget caches move requests, this causes us to
return incorrect values for the windowRect until the browser resets the rect.

This appears to work correctly today due to a bug in how the pending_window_rect
gets cached in RenderWidget but makes it difficult to fix that bug. See related
CL: https://codereview.chromium.org/2333353002/

Note: This change affects only LayoutTests.

BUG=638671

Review-Url: https://codereview.chromium.org/2354273002
Cr-Commit-Position: refs/heads/master@{#420557}
parent b15e4b9f
......@@ -34,7 +34,6 @@ function rootWindow() {
// - INPUT color with DATALIST
// - INPUT date/datetime-local/month/week
function openPicker(element, callback, errorCallback) {
rootWindow().moveTo(window.screenX, window.screenY);
element.offsetTop; // Force to lay out
element.focus();
if (element.tagName === "SELECT") {
......@@ -54,7 +53,6 @@ function openPicker(element, callback, errorCallback) {
}
function clickToOpenPicker(x, y, callback, errorCallback) {
rootWindow().moveTo(window.screenX, window.screenY);
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
......@@ -67,13 +65,7 @@ function clickToOpenPicker(x, y, callback, errorCallback) {
function setPopupOpenCallback(callback) {
console.assert(popupWindow);
popupOpenCallback = (function(callback) {
// We need to move the window to the top left of available space
// because the window will move back to (0, 0) when the
// ShellViewMsg_SetTestConfiguration IPC arrives.
rootWindow().moveTo(window.screenX, window.screenY);
callback();
}).bind(this, callback);
popupOpenCallback = callback;
try {
popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, false);
} catch(e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment