OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <head> | 2 <head> |
3 <script src="/js-test-resources/js-test.js"></script> | 3 <script src="/js-test-resources/js-test.js"></script> |
4 </head> | 4 </head> |
5 <button id="button" style="height: 100px; width: 100px;"> | 5 <button id="button" style="height: 100px; width: 100px;"> |
6 </button> | 6 </button> |
7 <button id="button_with_contextmenu" contextmenu="menu_id" style="height: 100px;
width: 100px;"> | 7 <button id="button_with_contextmenu" contextmenu="menu_id" style="height: 100px;
width: 100px;"> |
8 <menu id="menu_id" type="PopUp"> | 8 <menu id="menu_id" type="ConText"> |
9 <!-- Test removal of separator at the start. --> | 9 <!-- Test removal of separator at the start. --> |
10 <hr> | 10 <hr> |
11 <menuitem label="Item1"></menuitem> | 11 <menuitem label="Item1"></menuitem> |
12 <!-- Test disabled menuitem. --> | 12 <!-- Test disabled menuitem. --> |
13 <menuitem label="Item2" disabled></menuitem> | 13 <menuitem label="Item2" disabled></menuitem> |
14 <!-- Test addition of separator for <hr>. --> | 14 <!-- Test addition of separator for <hr>. --> |
15 <hr> | 15 <hr> |
16 <menuitem label="Item3"></menuitem> | 16 <menuitem label="Item3"></menuitem> |
17 <!-- Test child menu with label. --> | 17 <!-- Test child menu with label. --> |
18 <menu label="Submenu"> | 18 <menu label="Submenu"> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 <!-- Test with menu element without type attribute specified. --> | 70 <!-- Test with menu element without type attribute specified. --> |
71 <button id="button_1" contextmenu="menu_without_type" style="height: 100px; widt
h: 100px;"> | 71 <button id="button_1" contextmenu="menu_without_type" style="height: 100px; widt
h: 100px;"> |
72 <menu id="menu_without_type"> | 72 <menu id="menu_without_type"> |
73 <menuitem label="Item1"></menuitem> | 73 <menuitem label="Item1"></menuitem> |
74 <menuitem label="Item2"></menuitem> | 74 <menuitem label="Item2"></menuitem> |
75 <menuitem label="Item3"></menuitem> | 75 <menuitem label="Item3"></menuitem> |
76 </menu> | 76 </menu> |
77 </button> | 77 </button> |
78 <!-- Test cancelling show event. --> | 78 <!-- Test cancelling show event. --> |
79 <button id="button_2" contextmenu="menu_2" style="height: 100px; width: 100px;"> | 79 <button id="button_2" contextmenu="menu_2" style="height: 100px; width: 100px;"> |
80 <menu id="menu_2" type="popup"> | 80 <menu id="menu_2" type="context"> |
81 <menuitem label="Item1"></menuitem> | 81 <menuitem label="Item1"></menuitem> |
82 <menuitem label="Item2"></menuitem> | 82 <menuitem label="Item2"></menuitem> |
83 <menuitem label="Item3"></menuitem> | 83 <menuitem label="Item3"></menuitem> |
84 </menu> | 84 </menu> |
85 </button> | 85 </button> |
86 <!-- Test removing menu element inside show event handler. --> | 86 <!-- Test removing menu element inside show event handler. --> |
87 <button id="button_3" contextmenu="menu_3" style="height: 100px; width: 100px;"> | 87 <button id="button_3" contextmenu="menu_3" style="height: 100px; width: 100px;"> |
88 <menu id="menu_3" type="popup"> | 88 <menu id="menu_3" type="context"> |
89 <menuitem label="Item1"></menuitem> | 89 <menuitem label="Item1"></menuitem> |
90 <menuitem label="Item2"></menuitem> | 90 <menuitem label="Item2"></menuitem> |
91 <menuitem label="Item3"></menuitem> | 91 <menuitem label="Item3"></menuitem> |
92 </menu> | 92 </menu> |
93 </button> | 93 </button> |
94 <!-- Test with menu element without any children. --> | 94 <!-- Test with menu element without any children. --> |
95 <button id="button_4" contextmenu="menu_4" style="height: 100px; width: 100px;"> | 95 <button id="button_4" contextmenu="menu_4" style="height: 100px; width: 100px;"> |
96 <menu id="menu_4" type="popup"> | 96 <menu id="menu_4" type="context"> |
97 </menu> | 97 </menu> |
98 </button> | 98 </button> |
99 <!-- Test if an element A has a parent element, then A's assigned context menu i
s the assigned context menu of its parent element. --> | 99 <!-- Test if an element A has a parent element, then A's assigned context menu i
s the assigned context menu of its parent element. --> |
100 <div contextmenu="menu_5"> | 100 <div contextmenu="menu_5"> |
101 <div> | 101 <div> |
102 <button id="button_5" style="height: 100px; width: 100px;"></button> | 102 <button id="button_5" style="height: 100px; width: 100px;"></button> |
103 </div> | 103 </div> |
104 <menu id="menu_5" type="popup"> | 104 <menu id="menu_5" type="context"> |
105 <menuitem label="Item1"> | 105 <menuitem label="Item1"> |
106 <menuitem label="Item2"> | 106 <menuitem label="Item2"> |
107 <menuitem label="Item3"> | 107 <menuitem label="Item3"> |
108 </menu> | 108 </menu> |
109 </div> | 109 </div> |
110 <script> | 110 <script> |
111 if (!window.eventSender) | 111 if (!window.eventSender) |
112 debug("This test requires window.eventSender.") | 112 debug("This test requires window.eventSender.") |
113 | 113 |
114 function contextClickAndGetMenuItems(element) { | 114 function contextClickAndGetMenuItems(element) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 shouldBeEqualToNumber("items1.length - items.length", 0); | 197 shouldBeEqualToNumber("items1.length - items.length", 0); |
198 shouldBeEqualToNumber("items2.length - items.length", 0); | 198 shouldBeEqualToNumber("items2.length - items.length", 0); |
199 shouldBeEqualToNumber("items3.length - items.length", 0); | 199 shouldBeEqualToNumber("items3.length - items.length", 0); |
200 shouldBeEqualToNumber("items4.length - items.length", 0); | 200 shouldBeEqualToNumber("items4.length - items.length", 0); |
201 shouldBeEqualToNumber("items5.length - items.length", 3); | 201 shouldBeEqualToNumber("items5.length - items.length", 3); |
202 shouldBeEqualToString("items5[0]", "Item1"); | 202 shouldBeEqualToString("items5[0]", "Item1"); |
203 shouldBeEqualToString("items5[1]", "Item2"); | 203 shouldBeEqualToString("items5[1]", "Item2"); |
204 shouldBeEqualToString("items5[2]", "Item3"); | 204 shouldBeEqualToString("items5[2]", "Item3"); |
205 | 205 |
206 </script> | 206 </script> |
OLD | NEW |