Skip to content

Commit

Permalink
Merge remote-tracking branch 'c2d8037f017f007f59dfddbcb17e085a9a07252…
Browse files Browse the repository at this point in the history
…3' into embedlite_upgrade

Conflicts:
	gfx/thebes/gfxQtPlatform.cpp
	media/libtheora/lib/Makefile.in
	media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
	media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h
	media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
	media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h
	widget/qt/nsWindow.cpp
  • Loading branch information
tmeshkova committed Jan 25, 2014
2 parents 765175f + c2d8037 commit f6d0799
Show file tree
Hide file tree
Showing 984 changed files with 22,460 additions and 12,150 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

JS build system changes are apparently requiring clobbers.
Bug 948583, first part, apparently requires a clobber. (Ideas for fixing this involve removing jsopcode.tbl, which is a bit too big to do while holding up this patch.)
22 changes: 10 additions & 12 deletions accessible/src/generic/HyperTextAccessible.cpp
Expand Up @@ -331,18 +331,16 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
break;
}

// This offset no longer applies because the passed-in text object is not a child
// of the hypertext. This happens when there are nested hypertexts, e.g.
// <div>abc<h1>def</h1>ghi</div>
// If the passed-in DOM point was not on a direct child of the hypertext, we will
// return the offset for that entire hypertext
if (aIsEndOffset) {
// Not inclusive, the indicated char comes at index before this offset
// If the end offset is after the first character of the passed in object, use 1 for
// addTextOffset, to put us after the embedded object char. We'll only treat the offset as
// before the embedded object char if we end at the very beginning of the child.
addTextOffset = addTextOffset > 0;
} else
// This offset no longer applies because the passed-in text object is not
// a child of the hypertext. This happens when there are nested hypertexts,
// e.g. <div>abc<h1>def</h1>ghi</div>. Thus we need to adjust the offset
// to make it relative the hypertext.
// If the end offset is not supposed to be inclusive and the original point
// is not at 0 offset then the returned offset should be after an embedded
// character the original point belongs to.
if (aIsEndOffset)
addTextOffset = (addTextOffset > 0 || descendantAcc->IndexInParent() > 0) ? 1 : 0;
else
addTextOffset = 0;

descendantAcc = parentAcc;
Expand Down
48 changes: 43 additions & 5 deletions accessible/src/jsat/AccessFu.jsm
Expand Up @@ -506,23 +506,52 @@ var Output = {

webspeechEnabled: false,

deferredOutputs: [],

init: function init() {
let window = Utils.win;
this.webspeechEnabled = !!window.speechSynthesis;

let settingsToGet = 2;
let settingsCallback = (aName, aSetting) => {
if (--settingsToGet > 0) {
return;
}

this.inited = true;

for (let actions of this.deferredOutputs) {
this.output(actions);
}
};

this._volumeSetting = new SettingCache(
'accessibility.screenreader-volume', settingsCallback,
{ defaultValue: 1, callbackNow: true, callbackOnce: true });
this._rateSetting = new SettingCache(
'accessibility.screenreader-rate', settingsCallback,
{ defaultValue: 0, callbackNow: true, callbackOnce: true });

for (let earcon of this.EARCONS) {
let earconName = /(^.*)\..*$/.exec(earcon)[1];
this.earconBuffers[earconName] = new WeakMap();
this.earconBuffers[earconName].set(
window, new window.Audio('chrome://global/content/accessibility/' + earcon));
}
},

this.inited = true;
uninit: function uninit() {
if (this.inited) {
delete this._volumeSetting;
delete this._rateSetting;
}
this.inited = false;
},

output: function output(aActions) {
if (!this.inited) {
this.init();
this.deferredOutputs.push(aActions);
return;
}

for (let action of aActions) {
Expand All @@ -535,12 +564,18 @@ var Output = {
}

if (action.method === 'speak' && this.webspeechEnabled) {
window.speechSynthesis.speak(
new window.SpeechSynthesisUtterance(action.data));
let utterance = new window.SpeechSynthesisUtterance(action.data);
let requestedRate = this._rateSetting.value;
utterance.volume = this._volumeSetting.value;
utterance.rate = requestedRate >= 0 ?
requestedRate + 1 : 1 / (Math.abs(requestedRate) + 1);
window.speechSynthesis.speak(utterance);
} else if (action.method === 'playEarcon') {
let audioBufferWeakMap = this.earconBuffers[action.data];
if (audioBufferWeakMap) {
audioBufferWeakMap.get(window).cloneNode(false).play();
let node = audioBufferWeakMap.get(window).cloneNode(false);
node.volume = this._volumeSetting.value;
node.play();
}
}
}
Expand All @@ -549,6 +584,7 @@ var Output = {

start: function start() {
Cu.import('resource://gre/modules/Geometry.jsm');
this.speechHelper.init();
},

stop: function stop() {
Expand All @@ -561,6 +597,8 @@ var Output = {
Utils.win.document.documentElement.removeChild(this.announceBox.get());
delete this.announceBox;
}

this.speechHelper.uninit();
},

Speech: function Speech(aDetails, aBrowser) {
Expand Down
39 changes: 38 additions & 1 deletion accessible/src/jsat/Utils.jsm
Expand Up @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetter(this, 'Events',
XPCOMUtils.defineLazyModuleGetter(this, 'Relations',
'resource://gre/modules/accessibility/Constants.jsm');

this.EXPORTED_SYMBOLS = ['Utils', 'Logger', 'PivotContext', 'PrefCache'];
this.EXPORTED_SYMBOLS = ['Utils', 'Logger', 'PivotContext', 'PrefCache', 'SettingCache'];

this.Utils = {
_buildAppMap: {
Expand Down Expand Up @@ -774,3 +774,40 @@ PrefCache.prototype = {
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference])
};

this.SettingCache = function SettingCache(aName, aCallback, aOptions = {}) {
this.value = aOptions.defaultValue;
let runCallback = () => {
if (aCallback) {
aCallback(aName, this.value);
if (aOptions.callbackOnce) {
runCallback = () => {};
}
}
};

let settings = Utils.win.navigator.mozSettings;
if (!settings) {
if (aOptions.callbackNow) {
runCallback();
}
return;
}


let lock = settings.createLock();
let req = lock.get(aName);

req.addEventListener('success', () => {
this.value = req.result[aName] == undefined ? aOptions.defaultValue : req.result[aName];
if (aOptions.callbackNow) {
runCallback();
}
});

settings.addObserver(aName,
(evt) => {
this.value = evt.settingValue;
runCallback();
});
};
15 changes: 8 additions & 7 deletions accessible/src/jsat/content-script.js
Expand Up @@ -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);
}
}

Expand Down
13 changes: 13 additions & 0 deletions accessible/tests/mochitest/text/test_lineboundary.html
Expand Up @@ -120,6 +120,12 @@
testTextAtOffset([ "li1" ], BOUNDARY_LINE_START,
[ [ 0, 5, kDiscBulletChar + "Item", 0, 5 ] ]);

//////////////////////////////////////////////////////////////////////////
// Nested hypertexts

testTextAtOffset(["ht_5" ], BOUNDARY_LINE_START,
[ [ 0, 0, kEmbedChar, 0, 1 ] ]);

SimpleTest.finish();
}

Expand Down Expand Up @@ -190,5 +196,12 @@
<ul>
<li id="li1">Item</li>
</ul>

<div id="ht_5">
<div>
<p>sectiounus</p>
<p>seciofarus</p>
</div>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions b2g/app/b2g.js
Expand Up @@ -401,6 +401,7 @@ pref("dom.mozBrowserFramesEnabled", true);
pref("dom.ipc.processCount", 100000);

pref("dom.ipc.browser_frames.oop_by_default", false);
pref("dom.browser_frames.useAsyncPanZoom", false);

// SMS/MMS
pref("dom.sms.enabled", true);
Expand Down
9 changes: 8 additions & 1 deletion b2g/chrome/content/desktop.js
@@ -1,10 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

window.addEventListener("ContentStart", function(evt) {
// Enable touch event shim on desktop that translates mouse events
// into touch ones
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {})
.devtools.require;
let { TouchEventHandler } = require("devtools/touch-events");
let touchEventHandler = new TouchEventHandler(shell.contentBrowser);
let chromeEventHandler = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler || window;
let touchEventHandler = new TouchEventHandler(chromeEventHandler);
touchEventHandler.start();
});

0 comments on commit f6d0799

Please sign in to comment.