Index: chrome/browser/resources/shared/js/cr/ui/menu_item.js |
diff --git a/chrome/browser/resources/shared/js/cr/ui/menu_item.js b/chrome/browser/resources/shared/js/cr/ui/menu_item.js |
index 4638ddf91fc93b9566970e5078e4a5edd1f60b20..14bb04afae39c737be32e9f106f2ce499632dd1d 100644 |
--- a/chrome/browser/resources/shared/js/cr/ui/menu_item.js |
+++ b/chrome/browser/resources/shared/js/cr/ui/menu_item.js |
@@ -40,6 +40,8 @@ cr.define('cr.ui', function() { |
// the appearance of this element. |
this.classList.add('custom-appearance'); |
+ this.setAttribute('role', 'menuitem'); |
+ |
var iconUrl; |
if ((iconUrl = this.getAttribute('icon'))) |
this.iconUrl = iconUrl; |
@@ -183,8 +185,11 @@ cr.define('cr.ui', function() { |
// Store |contextElement| since it'll be removed by {Menu} on handling |
// 'activate' event. |
var contextElement = this.parentNode.contextElement; |
+ var activationEvent = cr.doc.createEvent('Event'); |
+ activationEvent.initEvent('activate', true, true); |
+ activationEvent.originalEvent = e; |
// Dispatch command event followed by executing the command object. |
- if (cr.dispatchSimpleEvent(this, 'activate', true, true)) { |
+ if (this.dispatchEvent(activationEvent)) { |
var command = this.command; |
if (command) { |
command.execute(contextElement); |