mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 960255 - Emit 'change' event after adjusting range widgets. r=yzen
This commit is contained in:
parent
9d62049fa4
commit
42d5b92630
@ -344,13 +344,21 @@ function scroll(aMessage) {
|
||||
function adjustRange(aMessage) {
|
||||
function sendUpDownKey(aAccessible) {
|
||||
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);
|
||||
let elem = acc.DOMNode;
|
||||
if (elem) {
|
||||
if (elem.tagName === 'INPUT' && elem.type === 'range') {
|
||||
elem[aMessage.json.direction === 'forward' ? 'stepDown' : 'stepUp']();
|
||||
let changeEvent = content.document.createEvent('UIEvent');
|
||||
changeEvent.initEvent('change', true, true);
|
||||
elem.dispatchEvent(changeEvent);
|
||||
} else {
|
||||
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);
|
||||
elem.dispatchEvent(evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user