Skip to content

Commit

Permalink
Merge latest green fx-team changeset and mozilla-central
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Morley committed May 1, 2014
2 parents 5a2f38f + ce3c038 commit 2cbd99b
Show file tree
Hide file tree
Showing 398 changed files with 8,074 additions and 6,435 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
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.

Bug 958889 moves files into the new mobile/android/base/tabspanel/ package.
Bug 1003702 - ICU is unhappy.
10 changes: 9 additions & 1 deletion accessible/src/jsat/OutputGenerator.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,14 @@ this.UtteranceGenerator = {

rowheader: function rowheader() {
return this.objectOutputFunctions.cell.apply(this, arguments);
},

statictext: function statictext(aAccessible) {
if (Utils.isListItemDecorator(aAccessible, true)) {
return [];
}

return this.objectOutputFunctions.defaultFunc.apply(this, arguments);
}
},

Expand Down Expand Up @@ -778,7 +786,7 @@ this.BrailleGenerator = {
statictext: function statictext(aAccessible, aRoleStr, aState, aFlags) {
// Since we customize the list bullet's output, we add the static
// text from the first node in each listitem, so skip it here.
if (aAccessible.parent.role == Roles.LISTITEM) {
if (Utils.isListItemDecorator(aAccessible)) {
return [];
}

Expand Down
65 changes: 39 additions & 26 deletions accessible/src/jsat/TraversalRules.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@
* 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/. */

/* global PrefCache, Roles, Prefilters, States, Filters, Utils,
TraversalRules */
/* exported TraversalRules */

'use strict';

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;

this.EXPORTED_SYMBOLS = ['TraversalRules'];
this.EXPORTED_SYMBOLS = ['TraversalRules']; // jshint ignore:line

Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'Roles',
XPCOMUtils.defineLazyModuleGetter(this, 'Roles', // jshint ignore:line
'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'Filters',
XPCOMUtils.defineLazyModuleGetter(this, 'Filters', // jshint ignore:line
'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'States',
XPCOMUtils.defineLazyModuleGetter(this, 'States', // jshint ignore:line
'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'Prefilters',
XPCOMUtils.defineLazyModuleGetter(this, 'Prefilters', // jshint ignore:line
'resource://gre/modules/accessibility/Constants.jsm');

let gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images');
Expand All @@ -30,7 +34,7 @@ function BaseTraversalRule(aRoles, aMatchFunc, aPreFilter) {
if (aRoles.indexOf(Roles.LABEL) < 0) {
this._matchRoles.push(Roles.LABEL);
}
this._matchFunc = aMatchFunc || function (acc) { return Filters.MATCH; };
this._matchFunc = aMatchFunc || function() { return Filters.MATCH; };
this.preFilter = aPreFilter || gSimplePreFilter;
}

Expand Down Expand Up @@ -91,17 +95,28 @@ var gSimpleTraversalRoles =
Roles.SLIDER,
Roles.SPINBUTTON,
Roles.OPTION,
Roles.LISTITEM,
// Used for traversing in to child OOP frames.
Roles.INTERNAL_FRAME];

var gSimpleMatchFunc = function gSimpleMatchFunc(aAccessible) {
function hasZeroOrSingleChildDescendants () {
for (let acc = aAccessible; acc.childCount > 0; acc = acc.firstChild) {
if (acc.childCount > 1) {
// An object is simple, if it either has a single child lineage,
// or has a flat subtree.
function isSingleLineage(acc) {
for (let child = acc; child; child = child.firstChild) {
if (child.childCount > 1) {
return false;
}
}
return true;
}

function isFlatSubtree(acc) {
for (let child = acc.firstChild; child; child = child.nextSibling) {
if (child.childCount > 0) {
return false;
}
}
return true;
}

Expand All @@ -114,30 +129,28 @@ var gSimpleMatchFunc = function gSimpleMatchFunc(aAccessible) {
{
// Nameless text leaves are boring, skip them.
let name = aAccessible.name;
if (name && name.trim())
return Filters.MATCH;
else
return Filters.IGNORE;
return (name && name.trim()) ? Filters.MATCH : Filters.IGNORE;
}
case Roles.STATICTEXT:
{
let parent = aAccessible.parent;
// Ignore prefix static text in list items. They are typically bullets or numbers.
if (parent.childCount > 1 && aAccessible.indexInParent == 0 &&
parent.role == Roles.LISTITEM)
return Filters.IGNORE;

return Filters.MATCH;
}
// Ignore prefix static text in list items. They are typically bullets or numbers.
return Utils.isListItemDecorator(aAccessible) ?
Filters.IGNORE : Filters.MATCH;
case Roles.GRAPHIC:
return TraversalRules._shouldSkipImage(aAccessible);
case Roles.HEADER:
case Roles.HEADING:
if ((aAccessible.childCount > 0 || aAccessible.name) &&
hasZeroOrSingleChildDescendants()) {
(isSingleLineage(aAccessible) || isFlatSubtree(aAccessible))) {
return Filters.MATCH | Filters.IGNORE_SUBTREE;
} else {
return Filters.IGNORE;
}
return Filters.IGNORE;
case Roles.LISTITEM:
{
let item = aAccessible.childCount === 2 &&
aAccessible.firstChild.role === Roles.STATICTEXT ?
aAccessible.lastChild : aAccessible;
return isSingleLineage(item) || isFlatSubtree(item) ?
Filters.MATCH | Filters.IGNORE_SUBTREE : Filters.IGNORE;
}
default:
// Ignore the subtree, if there is one. So that we don't land on
Expand All @@ -152,7 +165,7 @@ var gSimplePreFilter = Prefilters.DEFUNCT |
Prefilters.ARIA_HIDDEN |
Prefilters.TRANSPARENT;

this.TraversalRules = {
this.TraversalRules = { // jshint ignore:line
Simple: new BaseTraversalRule(gSimpleTraversalRoles, gSimpleMatchFunc),

SimpleOnScreen: new BaseTraversalRule(
Expand Down
11 changes: 11 additions & 0 deletions accessible/src/jsat/Utils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,17 @@ this.Utils = {
}

return null;
},

isListItemDecorator: function isListItemDecorator(aStaticText,
aExcludeOrdered) {
let parent = aStaticText.parent;
if (aExcludeOrdered && parent.parent.DOMNode.nodeName === 'OL') {
return false;
}

return parent.role === Roles.LISTITEM && parent.childCount > 1 &&
aStaticText.indexInParent === 0;
}
};

Expand Down
26 changes: 24 additions & 2 deletions accessible/tests/mochitest/jsat/test_output.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@
["1.", "list one"],
["1.", "list one"]
]
},
{
accOrElmOrID: "li_two",
expectedUtterance: [
["list 1 item", "First item", "list two"],
["list two", "First item", "list 1 item"]
],
expectedBraille: [
["*", "list two"],
["*", "list two"]
]
}, {
accOrElmOrID: "cell",
expectedUtterance: [[
Expand Down Expand Up @@ -339,8 +350,13 @@
["I am pressed!", "pressed toggle button"]],
expectedBraille: [["(x)", "I am pressed!"],
["I am pressed!", "(x)"]]
}
];
}, {
accOrElmOrID: "listbox-option",
expectedUtterance: [["list box", "option", "Search suggestion"],
["Search suggestion", "option", "list box"]],
expectedBraille: [["option", "Search suggestion"],
["Search suggestion", "option"]]
}];

// Test all possible utterance order preference values.
tests.forEach(function run(test) {
Expand Down Expand Up @@ -402,6 +418,9 @@ <h1 id="heading" title="Test heading"></h1>
<ol id="list">
<li id="li_one">list one</li>
</ol>
<ul id="unorderd_list">
<li id="li_two">list two</li>
</ul>
<dl id="dlist">
<dd id="dd_one">
dd one
Expand Down Expand Up @@ -454,6 +473,9 @@ <h1 id="heading" title="Test heading"></h1>
<label>Points: <input id="range" type="range" name="points" min="1" max="10" value="3"></label>
<div id="togglebutton_notpressed" aria-pressed="false" role="button" tabindex="-1">I ain't pressed</div>
<div id="togglebutton_pressed" aria-pressed="true" role="button" tabindex="-1">I am pressed!</div>
<ul role="listbox" style="list-style-type: none;">
<li role="option" id="listbox-option">Search suggestion</li>
</ul>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions accessible/tests/mochitest/jsat/test_traversal.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
'A esoteric weapon wielded by only the most ' +
'formidable warriors, for its unrelenting strict' +
' power is unfathomable.',
'Lists of Programming Languages', 'Lisp ',
'Scheme', 'Racket', 'Clojure', 'JavaScript', 'heading-5',
'Lists of Programming Languages', 'Lisp ',
'1. Scheme', '2. Racket', '3. Clojure', 'JavaScript', 'heading-5',
'image-2', 'image-3', 'Not actually an image',
'link-1', 'anchor-1', 'link-2', 'anchor-2', 'link-3',
'3', '1', '4', '1', 'Just an innocuous separator',
Expand Down
11 changes: 0 additions & 11 deletions browser/components/customizableui/content/panelUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,6 @@ const PanelUI = {
}
},

/**
* Open a dialog window that allow the user to customize listed character sets.
*/
onCharsetCustomizeCommand: function() {
this.hide();
window.openDialog("chrome://global/content/customizeCharset.xul",
"PrefWindow",
"chrome,modal=yes,resizable=yes",
"browser");
},

onWidgetAfterDOMChange: function(aNode, aNextNode, aContainer, aWasRemoval) {
if (aContainer != this.contents) {
return;
Expand Down
3 changes: 2 additions & 1 deletion build/autoconf/config.status.m4
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ EOF
fi
changequote([, ])
chmod +x $CONFIG_STATUS
])

define([MOZ_RUN_CONFIG_STATUS],
[
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
dnl Execute config.status, unless --no-create was passed to configure.
if test "$no_create" != yes && ! ${PYTHON} $CONFIG_STATUS; then
Expand Down
3 changes: 3 additions & 0 deletions build/autoconf/icu.m4
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_TRANSLITERATION"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_REGULAR_EXPRESSIONS"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_BREAK_ITERATION"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_IDNA"
# we don't need to pass data to and from legacy char* APIs
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_CHARSET_IS_UTF8"
# make sure to not accidentally pick up system-icu headers
ICU_CPPFLAGS="$ICU_CPPFLAGS -I$icudir/common -I$icudir/i18n"
Expand Down
8 changes: 3 additions & 5 deletions caps/src/nsSecurityManagerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext)
securityObj = &v.toObject();
} else {
/* define netscape.security object */
obj = JS_DefineObject(cx, global, "netscape", objectClass, nullptr, 0);
obj = JS_DefineObject(cx, global, "netscape", objectClass);
if (obj == nullptr)
return NS_ERROR_FAILURE;
securityObj = JS_DefineObject(cx, obj, "security", objectClass,
nullptr, 0);
securityObj = JS_DefineObject(cx, obj, "security", objectClass);
if (securityObj == nullptr)
return NS_ERROR_FAILURE;
}
Expand All @@ -118,8 +117,7 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext)
return NS_OK;

/* Define PrivilegeManager object with the necessary "static" methods. */
obj = JS_DefineObject(cx, securityObj, "PrivilegeManager", objectClass,
nullptr, 0);
obj = JS_DefineObject(cx, securityObj, "PrivilegeManager", objectClass);
if (obj == nullptr)
return NS_ERROR_FAILURE;

Expand Down
Loading

0 comments on commit 2cbd99b

Please sign in to comment.