diff --git a/accessible/src/jsat/content-script.js b/accessible/src/jsat/content-script.js index cc127bc08a6d..f2c68d8999e3 100644 --- a/accessible/src/jsat/content-script.js +++ b/accessible/src/jsat/content-script.js @@ -343,13 +343,14 @@ function scroll(aMessage) { function adjustRange(aMessage) { function sendUpDownKey(aAccessible) { - let evt = content.document.createEvent('KeyboardEvent'); - let keycode = aMessage.json.direction == 'forward' ? - content.KeyEvent.DOM_VK_DOWN : content.KeyEvent.DOM_VK_UP; - evt.initKeyEvent( - "keypress", false, true, null, false, false, false, false, keycode, 0); - if (aAccessible.DOMNode) { - aAccessible.DOMNode.dispatchEvent(evt); + let acc = Utils.getEmbeddedControl(aAccessible) || aAccessible; + if (acc.DOMNode) { + let evt = content.document.createEvent('KeyboardEvent'); + let keycode = aMessage.json.direction == 'forward' ? + content.KeyEvent.DOM_VK_DOWN : content.KeyEvent.DOM_VK_UP; + evt.initKeyEvent( + "keypress", false, true, null, false, false, false, false, keycode, 0); + acc.DOMNode.dispatchEvent(evt); } }