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 381eb2d3eb48f9166021b9d79ab8120fdeda6b70..70c07c6b3eec49858a28a91bed8a552655ae3524 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; |
@@ -124,8 +126,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); |