Bug 1081717 - Add attribute for finger-up activation in addition to key role. r=yzen

This commit is contained in:
Eitan Isaacson 2014-10-14 14:42:50 -07:00
parent dc73054ba9
commit 8b13301b72
3 changed files with 11 additions and 3 deletions

View File

@ -169,7 +169,7 @@ this.ContentControl.prototype = {
});
try {
if (aMessage.json.activateIfKey &&
aAccessible.role != Roles.KEY) {
!Utils.isActivatableOnFingerUp(aAccessible)) {
// Only activate keys, don't do anything on other objects.
return;
}
@ -210,7 +210,7 @@ this.ContentControl.prototype = {
}
}
if (aAccessible.role !== Roles.KEY) {
if (!Utils.isActivatableOnFingerUp(aAccessible)) {
// Keys will typically have a sound of their own.
this._contentScope.get().sendAsyncMessage('AccessFu:Present',
Presentation.actionInvoked(aAccessible, 'click'));

View File

@ -482,7 +482,7 @@ B2GPresenter.prototype.pivotChanged =
data: UtteranceGenerator.genForContext(aContext),
options: {
pattern: this.PIVOT_CHANGE_HAPTIC_PATTERN,
isKey: aContext.accessible.role === Roles.KEY,
isKey: Utils.isActivatableOnFingerUp(aContext.accessible),
reason: this.pivotChangedReasons[aReason],
isUserInput: aIsUserInput
}

View File

@ -470,6 +470,14 @@ this.Utils = { // jshint ignore:line
}));
}
},
isActivatableOnFingerUp: function isActivatableOnFingerUp(aAccessible) {
if (aAccessible.role === Roles.KEY) {
return true;
}
let quick_activate = this.getAttributes(aAccessible)['moz-quick-activate'];
return quick_activate && JSON.parse(quick_activate);
}
};