Bug 712871. (Fv1) Port bug 682618 ('lastElement'), Port bug 46555 ('context-selectall' fix). r=neil.

This commit is contained in:
Serge Gautherie 2011-12-23 04:09:47 +01:00
Родитель 506d7c4340
Коммит 048340d37f
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -28,6 +28,10 @@ function openContextMenuFor(element, shiftkey) {
// Context menu should be closed before we open it again. // Context menu should be closed before we open it again.
is(contextMenu.state, "closed", "checking if popup is closed"); is(contextMenu.state, "closed", "checking if popup is closed");
if (lastElement)
lastElement.blur();
element.focus();
lastElement = element;
var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey }; var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView); synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
} }
@ -304,7 +308,7 @@ function runTest(testNum) {
"context-paste", null, // ignore clipboard state "context-paste", null, // ignore clipboard state
"context-delete", false, "context-delete", false,
"---", null, "---", null,
"context-selectall", true, "context-selectall", false,
"---", null, "---", null,
"spell-check-enabled", true]); "spell-check-enabled", true]);
closeContextMenu() closeContextMenu()
@ -677,7 +681,7 @@ function runTest(testNum) {
var testNum = 1; var testNum = 1;
var subwindow, chromeWin, contextMenu; var subwindow, chromeWin, contextMenu, lastElement;
var text, link, mailto, input, img, img_link, img_mailto, canvas, video_ok, var text, link, mailto, input, img, img_link, img_mailto, canvas, video_ok,
video_bad, video_bad2, iframe, textarea, contenteditable, inputspell, video_bad, video_bad2, iframe, textarea, contenteditable, inputspell,
pagemenu; pagemenu;
@ -701,6 +705,8 @@ function startTest() {
return; return;
} }
lastElement = null;
text = subwindow.document.getElementById("test-text"); text = subwindow.document.getElementById("test-text");
link = subwindow.document.getElementById("test-link"); link = subwindow.document.getElementById("test-link");
mailto = subwindow.document.getElementById("test-mailto"); mailto = subwindow.document.getElementById("test-mailto");