зеркало из https://github.com/mozilla/pjs.git
Bug 501295. pluginGetEdge should return coordinates relative to the window frame in the Win32 test plugin. Then we can enable test_plugin_position on Windows. r=jmathies
This commit is contained in:
Родитель
13e891b13e
Коммит
70308cfd2b
|
@ -51,12 +51,6 @@ function runTests() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (navigator.platform.indexOf("Win") >= 0) {
|
|
||||||
todo(false, "Windows does not support windowed plugins (yet)");
|
|
||||||
SimpleTest.finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var bounds = h1.getBoundingClientRect();
|
var bounds = h1.getBoundingClientRect();
|
||||||
windowFrameX = h1.boxObject.screenX - bounds.left - window.screenX;
|
windowFrameX = h1.boxObject.screenX - bounds.left - window.screenX;
|
||||||
windowFrameY = h1.boxObject.screenY - bounds.top - window.screenY;
|
windowFrameY = h1.boxObject.screenY - bounds.top - window.screenY;
|
||||||
|
|
|
@ -211,24 +211,29 @@ pluginGetEdge(InstanceData* instanceData, RectEdge edge)
|
||||||
if (!instanceData || !instanceData->hasWidget)
|
if (!instanceData || !instanceData->hasWidget)
|
||||||
return NPTEST_INT32_ERROR;
|
return NPTEST_INT32_ERROR;
|
||||||
|
|
||||||
HWND hWnd = GetAncestor((HWND)instanceData->window.window, GA_ROOT);
|
// Get the plugin client rect in screen coordinates
|
||||||
|
|
||||||
if (!hWnd)
|
|
||||||
return NPTEST_INT32_ERROR;
|
|
||||||
|
|
||||||
RECT rect = {0};
|
RECT rect = {0};
|
||||||
GetClientRect((HWND)instanceData->window.window, &rect);
|
if (!::GetClientRect((HWND)instanceData->window.window, &rect))
|
||||||
MapWindowPoints((HWND)instanceData->window.window, hWnd, (LPPOINT)&rect, 2);
|
return NPTEST_INT32_ERROR;
|
||||||
|
::MapWindowPoints((HWND)instanceData->window.window, NULL, (LPPOINT)&rect, 2);
|
||||||
|
|
||||||
|
// Get the toplevel window frame rect in screen coordinates
|
||||||
|
HWND rootWnd = ::GetAncestor((HWND)instanceData->window.window, GA_ROOT);
|
||||||
|
if (!rootWnd)
|
||||||
|
return NPTEST_INT32_ERROR;
|
||||||
|
RECT rootRect;
|
||||||
|
if (!::GetWindowRect(rootWnd, &rootRect))
|
||||||
|
return NPTEST_INT32_ERROR;
|
||||||
|
|
||||||
switch (edge) {
|
switch (edge) {
|
||||||
case EDGE_LEFT:
|
case EDGE_LEFT:
|
||||||
return rect.left;
|
return rect.left - rootRect.left;
|
||||||
case EDGE_TOP:
|
case EDGE_TOP:
|
||||||
return rect.top;
|
return rect.top - rootRect.top;
|
||||||
case EDGE_RIGHT:
|
case EDGE_RIGHT:
|
||||||
return rect.right;
|
return rect.right - rootRect.left;
|
||||||
case EDGE_BOTTOM:
|
case EDGE_BOTTOM:
|
||||||
return rect.bottom;
|
return rect.bottom - rootRect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NPTEST_INT32_ERROR;
|
return NPTEST_INT32_ERROR;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче