6 let newTab = gBrowser.addTab();
7 gBrowser.selectedTab = newTab;
8 let
newBrowser = gBrowser.getBrowserForTab(newTab);
10 newBrowser.addEventListener(
"load",
function() {
11 newBrowser.removeEventListener(
"load",
arguments.callee,
true);
13 let
doc = newBrowser.contentWindow.document;
14 let testInput =
function(type,
expected) {
15 let
element = doc.createElement(
"input");
16 element.setAttribute(
"type", type);
17 doc.body.appendChild(element);
20 let contentAreaContextMenu = document.getElementById(
"contentAreaContextMenu");
21 let contextMenu =
new nsContextMenu(contentAreaContextMenu, gBrowser);
23 is(contextMenu.shouldDisplay,
expected,
"context menu behavior for <input type=" + type +
"> is wrong");
27 doc.body.appendChild(element);
30 let contentAreaContextMenu = document.getElementById(
"contentAreaContextMenu");
31 let contextMenu =
new nsContextMenu(contentAreaContextMenu, gBrowser);
33 is(contextMenu.shouldDisplay,
expected,
"context menu behavior for <" +
tag +
"> is wrong");
36 testInput(
"text",
true);
37 testInput(
"password",
true);
38 testInput(
"image",
true);
39 testInput(
"button",
false);
40 testInput(
"submit",
false);
41 testInput(
"reset",
false);
42 testInput(
"checkbox",
false);
43 testInput(
"radio",
false);
44 testElement(
"button",
false);
45 testElement(
"select",
false);
46 testElement(
"option",
false);
47 testElement(
"optgroup",
false);
50 document.popupNode =
null;
51 gBrowser.removeCurrentTab();
54 newBrowser.loadURI(
"data:text/html,test");
function doc() browser.contentDocument
return!aWindow arguments!aWindow arguments[0]
dataSBGenres SBProperties tag