--- a/.arcconfig
+++ b/.arcconfig
@@ -1,3 +1,4 @@
{
- "phabricator.uri" : "https://phabricator.services.mozilla.com/"
+ "phabricator.uri" : "https://phabricator.services.mozilla.com/",
+ "repository.callsign": "MOZILLACENTRAL"
}
--- a/.cargo/config.in
+++ b/.cargo/config.in
@@ -1,11 +1,18 @@
+# Note: if you add more configure substitutions here with required values
+# you will also need to fix the sed commands in:
+# taskcluster/scripts/builder/build-sm-mozjs-crate.sh
+# taskcluster/scripts/builder/build-sm-rust-bindings.sh
+
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source."https://github.com/gankro/serde"]
git = "https://github.com/gankro/serde"
-branch = "deserialize_from_enums3"
+branch = "deserialize_from_enums4"
replace-with = "vendored-sources"
[source.vendored-sources]
directory = '@top_srcdir@/third_party/rust'
+
+@WIN64_CARGO_LINKER_CONFIG@
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -2,16 +2,17 @@
build/clang-plugin/.*
# The two templates cannot be formatted
config/gcc-stl-wrapper.template.h
config/msvc-stl-wrapper.template.h
dom/base/test/.*
dom/bindings/test/.*
dom/media/gtest/.*
gfx/testsd/.*
+.*/gtest/ExampleStylesheet.h
image/test/.*
ipc/ipdl/test/.*
ipc/testshell/.*
js/src/jsapi-tests/.*
# See bug 1395584
js/src/vm/Opcodes.h
# Ignored because of bug 1342657
layout/style/nsCSSPropAliasList.h
--- a/.eslintignore
+++ b/.eslintignore
@@ -72,29 +72,34 @@ browser/branding/**/firefox-branding.js
# Gzipped test file.
browser/base/content/test/general/gZipOfflineChild.html
browser/base/content/test/urlbar/file_blank_but_not_blank.html
# New tab is likely to be replaced soon.
browser/base/content/newtab/**
# Test files that are really json not js, and don't need to be linted.
browser/components/sessionstore/test/unit/data/sessionstore_valid.js
browser/components/sessionstore/test/unit/data/sessionstore_invalid.js
+# This file is split into two in order to keep it as a valid json file
+# for documentation purposes (policies.json) but to be accessed by the
+# code as a .jsm (schema.jsm)
+browser/components/enterprisepolicies/schemas/schema.jsm
# generated & special files in cld2
browser/components/translation/cld2/**
# Screenshots and Follow-on search are imported as a system add-on and have
# their own lint rules currently.
browser/extensions/followonsearch/**
browser/extensions/screenshots/**
browser/extensions/pdfjs/content/build**
browser/extensions/pdfjs/content/web**
# generated or library files in pocket
browser/extensions/pocket/content/panels/js/tmpl.js
browser/extensions/pocket/content/panels/js/vendor/**
# generated or library files in activity-stream
browser/extensions/activity-stream/data/content/activity-stream.bundle.js
+browser/extensions/activity-stream/test/**
browser/extensions/activity-stream/vendor/**
# The only file in browser/locales/ is pre-processed.
browser/locales/**
# imported from chromium
browser/extensions/mortar/**
# Generated data files
browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.jsm
@@ -302,16 +307,17 @@ gfx/skia/**
js/ductwork/**
js/examples/**
js/ipc/**
js/public/**
js/xpconnect/**
js/src/devtools/**
js/src/octane/**
js/src/jit-test/**
+js/src/jsapi-tests/binast/**
js/src/tests/**
js/src/Y.js
# Third-party
media/webrtc/trunk/**
# mobile/android/ exclusions
mobile/android/tests/browser/chrome/tp5/**
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -23,28 +23,21 @@ module.exports = {
"files": "**/*.*html",
"rules": {
"eol-last": "off",
}
}, {
// XXX Bug 1421969. These files/directories are still being fixed,
// so turn off mozilla/use-services for them for now.
"files": [
- "accessible/**",
// Browser: Bug 1421379
"browser/extensions/shield-recipe-client/test/browser/head.js",
"browser/modules/offlineAppCache.jsm",
- "chrome/**",
"devtools/**",
- "dom/indexedDB/**",
- "dom/media/**",
"extensions/pref/**",
"mobile/android/**",
- "security/**",
"testing/**",
- "tools/profiler/**",
- "xpcom/**"
],
"rules": {
"mozilla/use-services": "off",
}
}]
};
--- a/.gitignore
+++ b/.gitignore
@@ -99,16 +99,20 @@ testing/web-platform/products/
# Android Gradle artifacts.
mobile/android/gradle/.gradle
# XCode project cruft
/*.xcodeproj/
embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/project.xcworkspace/xcuserdata
embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/xcuserdata
+# Rust port of mozbase are libraries
+testing/mozbase/rust/*/target
+testing/mozbase/rust/*/Cargo.lock
+
# Ignore mozharness execution files
testing/mozharness/.tox/
testing/mozharness/build/
testing/mozharness/logs/
testing/mozharness/.coverage
testing/mozharness/nosetests.xml
# Ignore ESLint node_modules
--- a/.hgignore
+++ b/.hgignore
@@ -106,16 +106,20 @@ GPATH
# Android Gradle artifacts.
^mobile/android/gradle/.gradle
# XCode project cruft
^[^/]*\.xcodeproj/
^embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/project.xcworkspace/xcuserdata
^embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/xcuserdata
+# Rust port of mozbase are Rust libraries
+^testing/mozbase/rust/.*/target
+^testing/mozbase/rust/.*/Cargo.lock
+
# Ignore mozharness execution files
^testing/mozharness/.tox/
^testing/mozharness/build/
^testing/mozharness/logs/
^testing/mozharness/.coverage
^testing/mozharness/nosetests.xml
# Ignore tox generated dir
@@ -140,20 +144,20 @@ GPATH
^testing/talos/talos/tests/tp5n
^testing/talos/talos/tests/devtools/damp.manifest.develop
^talos-venv
^py3venv
^testing/talos/talos/mitmproxy/mitmdump
^testing/talos/talos/mitmproxy/mitmproxy
^testing/talos/talos/mitmproxy/mitmweb
-# Ignore talos speedometer files; source is copied from in-tree /third_party
-# into testing/talos/talos/tests/webkit/PerformanceTests/Speedometer when
-# talos speedometer test is run locally
-^testing/talos/talos/tests/webkit/PerformanceTests/Speedometer
+# Ignore talos webkit benchmark files; source is copied from in-tree /third_party
+# into testing/talos/talos/tests/webkit/PerformanceTests/ when run locally
+# i.e. speedometer, motionmark, stylebench
+^testing/talos/talos/tests/webkit/PerformanceTests
# Ignore toolchains.json created by tooltool.
^toolchains\.json
# Ignore files created when running a reftest.
^lextab.py$
# tup database
--- a/.hgtags
+++ b/.hgtags
@@ -133,8 +133,9 @@ 1196bf3032e1bce1fb07a01fd9082a767426c5fb
f80dc9fc34680105b714a49b4704bb843f5f7004 FIREFOX_AURORA_53_BASE
6583496f169cd8a13c531ed16e98e8bf313eda8e FIREFOX_AURORA_54_BASE
f9605772a0c9098ed1bcaa98089b2c944ed69e9b FIREFOX_BETA_55_BASE
320642944e42a889db13c6c55b404e32319d4de6 FIREFOX_BETA_56_BASE
8e818b5e9b6bef0fc1a5c527ecf30b0d56a02f14 FIREFOX_BETA_57_BASE
f7e9777221a34f9f23c2e4933307eb38b621b679 FIREFOX_NIGHTLY_57_END
40a14ca1cf04499f398e4cb8ba359b39eae4e216 FIREFOX_BETA_58_BASE
1f91961bb79ad06fd4caef9e5dfd546afd5bf42c FIREFOX_NIGHTLY_58_END
+5faab9e619901b1513fd4ca137747231be550def FIREFOX_NIGHTLY_59_END
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -53,22 +53,20 @@ tasks:
routes:
$if: 'tasks_for == "hg-push"'
then:
- "index.gecko.v2.${repository.project}.latest.firefox.decision"
- "index.gecko.v2.${repository.project}.revision.${push.revision}.firefox.decision"
- "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.decision"
- "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
- - "tc-treeherder-stage.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
- "notify.email.${ownerEmail}.on-failed"
- "notify.email.${ownerEmail}.on-exception"
else:
- "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
- - "tc-treeherder-stage.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
- $if: 'tasks_for == "action"'
then: "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.actions.${ownTaskId}"
else: "index.gecko.v2.${repository.project}.latest.firefox.decision-${cron.job_name}"
scopes:
$if: 'tasks_for == "hg-push"'
then:
- 'assume:repo:${repoUrl[8:]}:*'
@@ -95,17 +93,17 @@ tasks:
GECKO_HEAD_REPOSITORY: '${repoUrl}'
GECKO_HEAD_REF: '${push.revision}'
GECKO_HEAD_REV: '${push.revision}'
GECKO_COMMIT_MSG: {$if: 'tasks_for != "action"', then: '${push.comment}'}
HG_STORE_PATH: /builds/worker/checkouts/hg-store
TASKCLUSTER_CACHES: /builds/worker/checkouts
- $if: 'tasks_for == "action"'
then:
- ACTION_TASK_GROUP_ID: '${action.taskGroupId}'
+ ACTION_TASK_GROUP_ID: '${ownTaskId}'
ACTION_TASK_ID: {$json: {$eval: 'taskId'}}
ACTION_TASK: {$json: {$eval: 'task'}}
ACTION_INPUT: {$json: {$eval: 'input'}}
ACTION_CALLBACK: '${action.cb_name}'
ACTION_PARAMETERS: {$json: {$eval: 'parameters'}}
cache:
level-${repository.level}-checkouts-sparse-v1: /builds/worker/checkouts
@@ -182,8 +180,12 @@ tasks:
parent: '${action.taskGroupId}'
action:
name: '${action.name}'
context:
taskGroupId: '${action.taskGroupId}'
taskId: {$eval: 'taskId'}
input: {$eval: 'input'}
parameters: {$eval: 'parameters'}
+ - $if: 'tasks_for == "cron"'
+ then:
+ cron: {$json: {$eval: 'cron'}}
+ - tasks_for: '${tasks_for}'
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
#
# Modifying this file will now automatically clobber the buildbot machines \o/
#
# Are you updating CLOBBER because you think it's needed for your WebIDL
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
-Bug 1416465 - Old track files may cause problems if they have wildcards.
+Merge day clobber
--- a/accessible/.eslintrc.js
+++ b/accessible/.eslintrc.js
@@ -4,14 +4,13 @@ module.exports = {
"rules": {
// Warn about cyclomatic complexity in functions.
"complexity": ["error", 42],
// XXX These are rules that are enabled in the recommended configuration, but
// disabled here due to failures when initially implemented. They should be
// removed (and hence enabled) at some stage.
"consistent-return": "off",
- "object-shorthand": "off",
"no-unexpected-multiline": "off",
"no-unsafe-finally": "off",
"no-useless-call": "off",
}
};
--- a/accessible/atk/Platform.cpp
+++ b/accessible/atk/Platform.cpp
@@ -14,17 +14,17 @@
#include "prenv.h"
#include "prlink.h"
#ifdef MOZ_ENABLE_DBUS
#include <dbus/dbus.h>
#endif
#include <gtk/gtk.h>
-#if (MOZ_WIDGET_GTK == 3)
+#ifdef MOZ_WIDGET_GTK
extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_init(int*, char **[]);
#endif
using namespace mozilla;
using namespace mozilla::a11y;
int atkMajorVersion = 1, atkMinorVersion = 12, atkMicroVersion = 0;
@@ -64,24 +64,16 @@ static GnomeAccessibilityModule sAtkBrid
"libatk-bridge.a(libatk-bridge.so.0)", nullptr,
#else
"libatk-bridge.so", nullptr,
#endif
"gnome_accessibility_module_init", nullptr,
"gnome_accessibility_module_shutdown", nullptr
};
-#if (MOZ_WIDGET_GTK == 2)
-static GnomeAccessibilityModule sGail = {
- "libgail.so", nullptr,
- "gnome_accessibility_module_init", nullptr,
- "gnome_accessibility_module_shutdown", nullptr
-};
-#endif
-
static nsresult
LoadGtkModule(GnomeAccessibilityModule& aModule)
{
NS_ENSURE_ARG(aModule.libName);
if (!(aModule.lib = PR_LoadLibrary(aModule.libName))) {
//try to load the module with "gtk-2.0/modules" appended
char *curLibPath = PR_GetLibraryPath();
@@ -97,21 +89,17 @@ LoadGtkModule(GnomeAccessibilityModule&
int16_t subLen = 0;
while (loc2 >= 0) {
loc2 = libPath.FindChar(':', loc1);
if (loc2 < 0)
subLen = libPath.Length() - loc1;
else
subLen = loc2 - loc1;
nsAutoCString sub(Substring(libPath, loc1, subLen));
-#if (MOZ_WIDGET_GTK == 2)
- sub.AppendLiteral("/gtk-2.0/modules/");
-#else
sub.AppendLiteral("/gtk-3.0/modules/");
-#endif
sub.Append(aModule.libName);
aModule.lib = PR_LoadLibrary(sub.get());
if (aModule.lib)
break;
loc1 = loc2+1;
}
if (!aModule.lib)
@@ -171,29 +159,22 @@ a11y::PlatformInit()
if (atkMajorVersion != 0L) {
atkMinorVersion = strtol(endPtr + 1, &endPtr, 10);
if (atkMinorVersion != 0L)
atkMicroVersion = strtol(endPtr + 1, &endPtr, 10);
}
}
}
-#if (MOZ_WIDGET_GTK == 2)
- // Load and initialize gail library.
- nsresult rv = LoadGtkModule(sGail);
- if (NS_SUCCEEDED(rv))
- (*sGail.init)();
-#endif
-
// Initialize the MAI Utility class, it will overwrite gail_util.
g_type_class_unref(g_type_class_ref(mai_util_get_type()));
// Init atk-bridge now
PR_SetEnv("NO_AT_BRIDGE=0");
-#if (MOZ_WIDGET_GTK == 3)
+#ifdef MOZ_WIDGET_GTK
if (atk_bridge_adaptor_init) {
atk_bridge_adaptor_init(nullptr, nullptr);
} else
#endif
{
nsresult rv = LoadGtkModule(sAtkBridge);
if (NS_SUCCEEDED(rv)) {
(*sAtkBridge.init)();
@@ -231,29 +212,16 @@ a11y::PlatformShutdown()
// an exit function registered will take care of it
// if (sAtkBridge.shutdown)
// (*sAtkBridge.shutdown)();
// PR_UnloadLibrary(sAtkBridge.lib);
sAtkBridge.lib = nullptr;
sAtkBridge.init = nullptr;
sAtkBridge.shutdown = nullptr;
}
-#if (MOZ_WIDGET_GTK == 2)
- if (sGail.lib) {
- // Do not shutdown gail because
- // 1) Maybe it's not init-ed by us. e.g. GtkEmbed
- // 2) We need it to avoid assert in spi_atk_tidy_windows
- // if (sGail.shutdown)
- // (*sGail.shutdown)();
- // PR_UnloadLibrary(sGail.lib);
- sGail.lib = nullptr;
- sGail.init = nullptr;
- sGail.shutdown = nullptr;
- }
-#endif
// if (sATKLib) {
// PR_UnloadLibrary(sATKLib);
// sATKLib = nullptr;
// }
}
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
#ifdef MOZ_ENABLE_DBUS
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -612,16 +612,47 @@ static const nsRoleMapEntry sWAIRoleMaps
roles::FORM,
kUseMapRole,
eNoValue,
eNoAction,
eNoLiveAttr,
eLandmark,
kNoReqStates
},
+ { // graphics-document
+ &nsGkAtoms::graphicsDocument,
+ roles::DOCUMENT,
+ kUseMapRole,
+ eNoValue,
+ eNoAction,
+ eNoLiveAttr,
+ kGenericAccType,
+ kNoReqStates,
+ eReadonlyUntilEditable
+ },
+ { // graphics-object
+ &nsGkAtoms::graphicsObject,
+ roles::GROUPING,
+ kUseMapRole,
+ eNoValue,
+ eNoAction,
+ eNoLiveAttr,
+ kGenericAccType,
+ kNoReqStates
+ },
+ { // graphics-symbol
+ &nsGkAtoms::graphicsSymbol,
+ roles::GRAPHIC,
+ kUseMapRole,
+ eNoValue,
+ eNoAction,
+ eNoLiveAttr,
+ kGenericAccType,
+ kNoReqStates
+ },
{ // grid
&nsGkAtoms::grid,
roles::TABLE,
kUseMapRole,
eNoValue,
eNoAction,
eNoLiveAttr,
eSelect | eTable,
@@ -1370,18 +1401,20 @@ aria::AttrCharacteristicsFor(nsAtom* aAt
return 0;
}
bool
aria::HasDefinedARIAHidden(nsIContent* aContent)
{
return aContent &&
nsAccUtils::HasDefinedARIAToken(aContent, nsGkAtoms::aria_hidden) &&
- !aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_hidden,
- nsGkAtoms::_false, eCaseMatters);
+ !aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::aria_hidden,
+ nsGkAtoms::_false,
+ eCaseMatters);
}
////////////////////////////////////////////////////////////////////////////////
// AttrIterator class
bool
AttrIterator::Next(nsAString& aAttrName, nsAString& aAttrValue)
{
--- a/accessible/base/ARIAStateMap.cpp
+++ b/accessible/base/ARIAStateMap.cpp
@@ -18,17 +18,17 @@ using namespace mozilla::a11y::aria;
* Used to store state map rule data for ARIA attribute of enum type.
*/
struct EnumTypeData
{
// ARIA attribute name.
nsStaticAtom* const mAttrName;
// States if the attribute value is matched to the enum value. Used as
- // nsIContent::AttrValuesArray, last item must be nullptr.
+ // Element::AttrValuesArray, last item must be nullptr.
nsStaticAtom* const* const mValues[4];
// States applied if corresponding enum values are matched.
const uint64_t mStates[3];
// States to clear in case of match.
const uint64_t mClearState;
};
--- a/accessible/base/AccIterator.cpp
+++ b/accessible/base/AccIterator.cpp
@@ -80,17 +80,18 @@ RelatedAccIterator::
mDocument(aDocument), mRelAttr(aRelAttr), mProviders(nullptr),
mBindingParent(nullptr), mIndex(0)
{
mBindingParent = aDependentContent->GetBindingParent();
nsAtom* IDAttr = mBindingParent ?
nsGkAtoms::anonid : nsGkAtoms::id;
nsAutoString id;
- if (aDependentContent->GetAttr(kNameSpaceID_None, IDAttr, id))
+ if (aDependentContent->IsElement() &&
+ aDependentContent->AsElement()->GetAttr(kNameSpaceID_None, IDAttr, id))
mProviders = mDocument->mDependentIDsHash.Get(id);
}
Accessible*
RelatedAccIterator::Next()
{
if (!mProviders)
return nullptr;
@@ -160,17 +161,17 @@ HTMLLabelIterator::Next()
// Go up tree to get a name of ancestor label if there is one (an ancestor
// <label> implicitly points to us). Don't go up farther than form or
// document.
Accessible* walkUp = mAcc->Parent();
while (walkUp && !walkUp->IsDoc()) {
nsIContent* walkUpEl = walkUp->GetContent();
if (IsLabel(walkUp) &&
- !walkUpEl->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) {
+ !walkUpEl->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) {
mLabelFilter = eSkipAncestorLabel; // prevent infinite loop
return walkUp;
}
if (walkUpEl->IsHTMLElement(nsGkAtoms::form))
break;
walkUp = walkUp->Parent();
@@ -252,18 +253,18 @@ XULDescriptionIterator::Next()
// IDRefsIterator
////////////////////////////////////////////////////////////////////////////////
IDRefsIterator::
IDRefsIterator(DocAccessible* aDoc, nsIContent* aContent,
nsAtom* aIDRefsAttr) :
mContent(aContent), mDoc(aDoc), mCurrIdx(0)
{
- if (mContent->IsInUncomposedDoc())
- mContent->GetAttr(kNameSpaceID_None, aIDRefsAttr, mIDs);
+ if (mContent->IsInUncomposedDoc() && mContent->IsElement())
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, aIDRefsAttr, mIDs);
}
const nsDependentSubstring
IDRefsIterator::NextID()
{
for (; mCurrIdx < mIDs.Length(); mCurrIdx++) {
if (!NS_IsAsciiWhitespace(mIDs[mCurrIdx]))
break;
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -829,17 +829,17 @@ logging::Node(const char* aDescr, nsINod
}
if (aNode->IsNodeOfType(nsINode::eDOCUMENT)) {
printf("%s: %p, document\n", aDescr, static_cast<void*>(aNode));
return;
}
nsINode* parentNode = aNode->GetParentNode();
- int32_t idxInParent = parentNode ? parentNode->IndexOf(aNode) : - 1;
+ int32_t idxInParent = parentNode ? parentNode->ComputeIndexOf(aNode) : - 1;
if (aNode->IsNodeOfType(nsINode::eTEXT)) {
printf("%s: %p, text node, idx in parent: %d\n",
aDescr, static_cast<void*>(aNode), idxInParent);
return;
}
if (!aNode->IsElement()) {
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -414,33 +414,33 @@ NotificationController::ScheduleChildDoc
ScheduleProcessing();
}
void
NotificationController::ScheduleContentInsertion(Accessible* aContainer,
nsIContent* aStartChildNode,
nsIContent* aEndChildNode)
{
- nsTArray<nsCOMPtr<nsIContent>>* list =
- mContentInsertions.LookupOrAdd(aContainer);
+ nsTArray<nsCOMPtr<nsIContent>> list;
bool needsProcessing = false;
nsIContent* node = aStartChildNode;
while (node != aEndChildNode) {
// Notification triggers for content insertion even if no content was
// actually inserted, check if the given content has a frame to discard
// this case early.
if (node->GetPrimaryFrame()) {
- if (list->AppendElement(node))
+ if (list.AppendElement(node))
needsProcessing = true;
}
node = node->GetNextSibling();
}
if (needsProcessing) {
+ mContentInsertions.LookupOrAdd(aContainer)->AppendElements(list);
ScheduleProcessing();
}
}
void
NotificationController::ScheduleProcessing()
{
// If notification flush isn't planed yet start notification flush
@@ -454,21 +454,41 @@ NotificationController::ScheduleProcessi
////////////////////////////////////////////////////////////////////////////////
// NotificationCollector: protected
bool
NotificationController::IsUpdatePending()
{
return mPresShell->IsLayoutFlushObserver() ||
mObservingState == eRefreshProcessingForUpdate ||
+ WaitingForParent() ||
mContentInsertions.Count() != 0 || mNotifications.Length() != 0 ||
mTextHash.Count() != 0 ||
!mDocument->HasLoadState(DocAccessible::eTreeConstructed);
}
+bool
+NotificationController::WaitingForParent()
+{
+ DocAccessible* parentdoc = mDocument->ParentDocument();
+ if (!parentdoc) {
+ return false;
+ }
+
+ NotificationController* parent = parentdoc->mNotificationController;
+ if (!parent || parent == this) {
+ // Do not wait for nothing or ourselves
+ return false;
+ }
+
+ // Wait for parent's notifications processing
+ return parent->mContentInsertions.Count() != 0 ||
+ parent->mNotifications.Length() != 0;
+}
+
void
NotificationController::ProcessMutationEvents()
{
// there is no reason to fire a hide event for a child of a show event
// target. That can happen if something is inserted into the tree and
// removed before the next refresh driver tick, but it should not be
// observable outside gecko so it should be safe to coalesce away any such
// events. This means that it should be fine to fire all of the hide events
@@ -587,16 +607,18 @@ NotificationController::ProcessMutationE
}
////////////////////////////////////////////////////////////////////////////////
// NotificationCollector: private
void
NotificationController::WillRefresh(mozilla::TimeStamp aTime)
{
+ Telemetry::AutoTimer<Telemetry::A11Y_TREE_UPDATE_TIMING_MS> timer;
+
AUTO_PROFILER_LABEL("NotificationController::WillRefresh", OTHER);
// If the document accessible that notification collector was created for is
// now shut down, don't process notifications anymore.
NS_ASSERTION(mDocument,
"The document was shut down while refresh observer is attached!");
if (!mDocument)
return;
@@ -604,16 +626,25 @@ NotificationController::WillRefresh(mozi
// Wait until an update, we have started, or an interruptible reflow is
// finished.
if (mObservingState == eRefreshProcessing ||
mObservingState == eRefreshProcessingForUpdate ||
mPresShell->IsReflowInterrupted()) {
return;
}
+ // Process parent's notifications before ours, to get proper ordering between
+ // e.g. tab event and content event.
+ if (WaitingForParent()) {
+ mDocument->ParentDocument()->mNotificationController->WillRefresh(aTime);
+ if (!mDocument) {
+ return;
+ }
+ }
+
// Any generic notifications should be queued if we're processing content
// insertions or generic notifications.
mObservingState = eRefreshProcessingForUpdate;
// Initial accessible tree construction.
if (!mDocument->HasLoadState(DocAccessible::eTreeConstructed)) {
// If document is not bound to parent at this point then the document is not
// ready yet (process notifications later).
@@ -644,19 +675,18 @@ NotificationController::WillRefresh(mozi
for (auto iter = mTextHash.Iter(); !iter.Done(); iter.Next()) {
nsCOMPtrHashKey<nsIContent>* entry = iter.Get();
nsIContent* textNode = entry->GetKey();
Accessible* textAcc = mDocument->GetAccessible(textNode);
// If the text node is not in tree or doesn't have a frame, or placed in
// another document, then this case should have been handled already by
// content removal notifications.
- nsINode* containerNode = textNode->GetParentNode();
- if (!containerNode ||
- textNode->GetOwnerDocument() != mDocument->DocumentNode()) {
+ nsINode* containerNode = textNode->GetFlattenedTreeParentNode();
+ if (!containerNode || textNode->OwnerDoc() != mDocument->DocumentNode()) {
MOZ_ASSERT(!textAcc,
"Text node was removed but accessible is kept alive!");
continue;
}
nsIFrame* textFrame = textNode->GetPrimaryFrame();
if (!textFrame) {
MOZ_ASSERT(!textAcc,
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -269,16 +269,22 @@ protected:
nsCycleCollectingAutoRefCnt mRefCnt;
NS_DECL_OWNINGTHREAD
/**
* Return true if the accessible tree state update is pending.
*/
bool IsUpdatePending();
+ /**
+ * Return true if we should wait for processing from the parent before we can
+ * process our own queue.
+ */
+ bool WaitingForParent();
+
private:
NotificationController(const NotificationController&);
NotificationController& operator = (const NotificationController&);
// nsARefreshObserver
virtual void WillRefresh(mozilla::TimeStamp aTime) override;
/**
--- a/accessible/base/TextAttrs.cpp
+++ b/accessible/base/TextAttrs.cpp
@@ -296,23 +296,23 @@ TextAttrsMgr::InvalidTextAttr::
bool
TextAttrsMgr::InvalidTextAttr::
GetValue(nsIContent* aElm, uint32_t* aValue)
{
nsIContent* elm = aElm;
do {
if (nsAccUtils::HasDefinedARIAToken(elm, nsGkAtoms::aria_invalid)) {
- static nsIContent::AttrValuesArray tokens[] =
+ static Element::AttrValuesArray tokens[] =
{ &nsGkAtoms::_false, &nsGkAtoms::grammar, &nsGkAtoms::spelling,
nullptr };
- int32_t idx = elm->FindAttrValueIn(kNameSpaceID_None,
- nsGkAtoms::aria_invalid, tokens,
- eCaseMatters);
+ int32_t idx = elm->AsElement()->FindAttrValueIn(kNameSpaceID_None,
+ nsGkAtoms::aria_invalid,
+ tokens, eCaseMatters);
switch (idx) {
case 0:
*aValue = eFalse;
return true;
case 1:
*aValue = eGrammar;
return true;
case 2:
--- a/accessible/base/TreeWalker.cpp
+++ b/accessible/base/TreeWalker.cpp
@@ -71,16 +71,18 @@ TreeWalker::~TreeWalker()
Accessible*
TreeWalker::Scope(nsIContent* aAnchorNode)
{
Reset();
mAnchorNode = aAnchorNode;
+ mFlags |= eScoped;
+
bool skipSubtree = false;
Accessible* acc = AccessibleFor(aAnchorNode, 0, &skipSubtree);
if (acc) {
mPhase = eAtEnd;
return acc;
}
return skipSubtree ? nullptr : Next();
@@ -107,16 +109,18 @@ TreeWalker::Seek(nsIContent* aChildNode)
if (!parentNode || !parentNode->IsElement()) {
return false;
}
// If ARIA owned child.
Accessible* child = mDoc->GetAccessible(childNode);
if (child && child->IsRelocated()) {
+ MOZ_ASSERT(!(mFlags & eScoped),
+ "Walker should not be scoped when seeking into relocated children");
if (child->Parent() != mContext) {
return false;
}
Accessible* ownedChild = nullptr;
while ((ownedChild = mDoc->ARIAOwnedAt(mContext, mARIAOwnsIdx++)) &&
ownedChild != child);
@@ -144,22 +148,26 @@ Accessible*
TreeWalker::Next()
{
if (mStateStack.IsEmpty()) {
if (mPhase == eAtEnd) {
return nullptr;
}
if (mPhase == eAtDOM || mPhase == eAtARIAOwns) {
- mPhase = eAtARIAOwns;
- Accessible* child = mDoc->ARIAOwnedAt(mContext, mARIAOwnsIdx);
- if (child) {
- mARIAOwnsIdx++;
- return child;
+ if (!(mFlags & eScoped)) {
+ mPhase = eAtARIAOwns;
+ Accessible* child = mDoc->ARIAOwnedAt(mContext, mARIAOwnsIdx);
+ if (child) {
+ mARIAOwnsIdx++;
+ return child;
+ }
}
+ MOZ_ASSERT(!(mFlags & eScoped) || mPhase != eAtARIAOwns,
+ "Don't walk relocated children in scoped mode");
mPhase = eAtEnd;
return nullptr;
}
if (!mAnchorNode) {
mPhase = eAtEnd;
return nullptr;
}
@@ -225,21 +233,27 @@ TreeWalker::Prev()
{
if (mStateStack.IsEmpty()) {
if (mPhase == eAtStart || mPhase == eAtDOM) {
mPhase = eAtStart;
return nullptr;
}
if (mPhase == eAtEnd) {
- mARIAOwnsIdx = mDoc->ARIAOwnedCount(mContext);
- mPhase = eAtARIAOwns;
+ if (mFlags & eScoped) {
+ mPhase = eAtDOM;
+ } else {
+ mPhase = eAtARIAOwns;
+ mARIAOwnsIdx = mDoc->ARIAOwnedCount(mContext);
+ }
}
if (mPhase == eAtARIAOwns) {
+ MOZ_ASSERT(!(mFlags & eScoped),
+ "Should not walk relocated children in scoped mode");
if (mARIAOwnsIdx > 0) {
return mDoc->ARIAOwnedAt(mContext, --mARIAOwnsIdx);
}
if (!mAnchorNode) {
mPhase = eAtStart;
return nullptr;
}
--- a/accessible/base/TreeWalker.h
+++ b/accessible/base/TreeWalker.h
@@ -24,17 +24,18 @@ class DocAccessible;
*/
class TreeWalker final
{
public:
enum {
// used to walk the existing tree of the given node
eWalkCache = 1,
// used to walk the context tree starting from given node
- eWalkContextTree = 2 | eWalkCache
+ eWalkContextTree = 2 | eWalkCache,
+ eScoped = 4
};
/**
* Used to navigate and create if needed the accessible children.
*/
explicit TreeWalker(Accessible* aContext);
/**
--- a/accessible/base/nsAccUtils.cpp
+++ b/accessible/base/nsAccUtils.cpp
@@ -136,83 +136,90 @@ nsAccUtils::SetLiveContainerAttributes(n
{
nsAutoString live, relevant, busy;
nsIContent* ancestor = aStartContent;
while (ancestor) {
// container-relevant attribute
if (relevant.IsEmpty() &&
HasDefinedARIAToken(ancestor, nsGkAtoms::aria_relevant) &&
- ancestor->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_relevant, relevant))
+ ancestor->AsElement()->GetAttr(kNameSpaceID_None,
+ nsGkAtoms::aria_relevant, relevant))
SetAccAttr(aAttributes, nsGkAtoms::containerRelevant, relevant);
// container-live, and container-live-role attributes
if (live.IsEmpty()) {
const nsRoleMapEntry* role = nullptr;
if (ancestor->IsElement()) {
role = aria::GetRoleMap(ancestor->AsElement());
}
if (HasDefinedARIAToken(ancestor, nsGkAtoms::aria_live)) {
- ancestor->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_live, live);
+ ancestor->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_live, live);
} else if (role) {
GetLiveAttrValue(role->liveAttRule, live);
}
if (!live.IsEmpty()) {
SetAccAttr(aAttributes, nsGkAtoms::containerLive, live);
if (role) {
SetAccAttr(aAttributes, nsGkAtoms::containerLiveRole,
role->ARIARoleString());
}
}
}
// container-atomic attribute
- if (ancestor->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_atomic,
- nsGkAtoms::_true, eCaseMatters)) {
+ if (ancestor->IsElement() &&
+ ancestor->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::aria_atomic,
+ nsGkAtoms::_true, eCaseMatters)) {
SetAccAttr(aAttributes, nsGkAtoms::containerAtomic,
NS_LITERAL_STRING("true"));
}
// container-busy attribute
if (busy.IsEmpty() &&
HasDefinedARIAToken(ancestor, nsGkAtoms::aria_busy) &&
- ancestor->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_busy, busy))
+ ancestor->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_busy, busy))
SetAccAttr(aAttributes, nsGkAtoms::containerBusy, busy);
if (ancestor == aTopEl)
break;
ancestor = ancestor->GetParent();
if (!ancestor)
ancestor = aTopEl; // Use <body>/<frameset>
}
}
bool
nsAccUtils::HasDefinedARIAToken(nsIContent *aContent, nsAtom *aAtom)
{
NS_ASSERTION(aContent, "aContent is null in call to HasDefinedARIAToken!");
- if (!aContent->HasAttr(kNameSpaceID_None, aAtom) ||
- aContent->AttrValueIs(kNameSpaceID_None, aAtom,
- nsGkAtoms::_empty, eCaseMatters) ||
- aContent->AttrValueIs(kNameSpaceID_None, aAtom,
- nsGkAtoms::_undefined, eCaseMatters)) {
+ if (!aContent->IsElement())
+ return false;
+
+ Element* element = aContent->AsElement();
+ if (!element->HasAttr(kNameSpaceID_None, aAtom) ||
+ element->AttrValueIs(kNameSpaceID_None, aAtom, nsGkAtoms::_empty,
+ eCaseMatters) ||
+ element->AttrValueIs(kNameSpaceID_None, aAtom, nsGkAtoms::_undefined,
+ eCaseMatters)) {
return false;
}
return true;
}
nsAtom*
nsAccUtils::GetARIAToken(dom::Element* aElement, nsAtom* aAttr)
{
if (!HasDefinedARIAToken(aElement, aAttr))
return nsGkAtoms::_empty;
- static nsIContent::AttrValuesArray tokens[] =
+ static Element::AttrValuesArray tokens[] =
{ &nsGkAtoms::_false, &nsGkAtoms::_true,
&nsGkAtoms::mixed, nullptr};
int32_t idx = aElement->FindAttrValueIn(kNameSpaceID_None,
aAttr, tokens, eCaseMatters);
if (idx >= 0)
return *(tokens[idx]);
@@ -234,17 +241,19 @@ nsAccUtils::GetSelectableContainer(Acces
return nullptr;
}
return parent;
}
bool
nsAccUtils::IsARIASelected(Accessible* aAccessible)
{
- return aAccessible->GetContent()->
+ if (!aAccessible->GetContent()->IsElement())
+ return false;
+ return aAccessible->GetContent()->AsElement()->
AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_selected,
nsGkAtoms::_true, eCaseMatters);
}
Accessible*
nsAccUtils::TableFor(Accessible* aRow)
{
if (aRow) {
@@ -354,17 +363,17 @@ nsAccUtils::GetScreenCoordsForParent(Acc
if (!parent)
return nsIntPoint(0, 0);
nsIFrame *parentFrame = parent->GetFrame();
if (!parentFrame)
return nsIntPoint(0, 0);
nsRect rect = parentFrame->GetScreenRectInAppUnits();
- return nsPoint(rect.x, rect.y).
+ return nsPoint(rect.X(), rect.Y()).
ToNearestPixels(parentFrame->PresContext()->AppUnitsPerDevPixel());
}
bool
nsAccUtils::GetLiveAttrValue(uint32_t aRule, nsAString& aValue)
{
switch (aRule) {
case eOffLiveAttr:
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -204,30 +204,35 @@ New_HTMLDefinition(nsIContent* aContent,
return nullptr;
}
static Accessible* New_HTMLLabel(nsIContent* aContent, Accessible* aContext)
{ return new HTMLLabelAccessible(aContent, aContext->Document()); }
static Accessible* New_HTMLInput(nsIContent* aContent, Accessible* aContext)
{
- if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::checkbox, eIgnoreCase)) {
+ if (!aContent->IsElement()) {
+ return nullptr;
+ }
+
+ Element* element = aContent->AsElement();
+ if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::checkbox, eIgnoreCase)) {
return new HTMLCheckboxAccessible(aContent, aContext->Document());
}
- if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::radio, eIgnoreCase)) {
+ if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::radio, eIgnoreCase)) {
return new HTMLRadioButtonAccessible(aContent, aContext->Document());
}
- if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::time, eIgnoreCase)) {
+ if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::time, eIgnoreCase)) {
return new EnumRoleAccessible<roles::GROUPING>(aContent, aContext->Document());
}
- if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::date, eIgnoreCase)) {
+ if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::date, eIgnoreCase)) {
return new EnumRoleAccessible<roles::DATE_EDITOR>(aContent, aContext->Document());
}
return nullptr;
}
static Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext)
{ return new HTMLOutputAccessible(aContent, aContext->Document()); }
@@ -256,32 +261,35 @@ New_HTMLTableHeaderCell(nsIContent* aCon
return new HTMLTableHeaderCellAccessibleWrap(aContent, aContext->Document());
return nullptr;
}
static Accessible*
New_HTMLTableHeaderCellIfScope(nsIContent* aContent, Accessible* aContext)
{
if (aContext->IsTableRow() && aContext->GetContent() == aContent->GetParent() &&
- aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scope))
+ aContent->IsElement() &&
+ aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::scope))
return new HTMLTableHeaderCellAccessibleWrap(aContent, aContext->Document());
return nullptr;
}
#ifdef MOZ_XUL
static Accessible*
New_MaybeImageOrToolbarButtonAccessible(nsIContent* aContent,
Accessible* aContext)
{
- if (aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
+ if (aContent->IsElement() &&
+ aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
return new XULToolbarButtonAccessible(aContent, aContext->Document());
}
// Don't include nameless images in accessible tree.
- if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext)) {
+ if (!aContent->IsElement() ||
+ !aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext)) {
return nullptr;
}
return new ImageAccessibleWrap(aContent, aContext->Document());
}
static Accessible*
New_MenuSeparator(nsIContent* aContent, Accessible* aContext)
{ return new XULMenuSeparatorAccessible(aContent, aContext->Document()); }
@@ -469,17 +477,17 @@ class PluginTimerCallBack final : public
{
~PluginTimerCallBack() {}
public:
explicit PluginTimerCallBack(nsIContent* aContent) : mContent(aContent) {}
NS_DECL_ISUPPORTS
- NS_IMETHOD Notify(nsITimer* aTimer) final
+ NS_IMETHOD Notify(nsITimer* aTimer) final override
{
if (!mContent->IsInUncomposedDoc())
return NS_OK;
nsIPresShell* ps = mContent->OwnerDoc()->GetShell();
if (ps) {
DocAccessible* doc = ps->GetDocAccessible();
if (doc) {
@@ -493,17 +501,17 @@ public:
// We couldn't get a doc accessible so presumably the document went away.
// In this case don't leak our ref to the content or timer.
sPendingPlugins->RemoveElement(mContent);
sPluginTimers->RemoveElement(aTimer);
return NS_OK;
}
- NS_IMETHOD GetName(nsACString& aName) final
+ NS_IMETHOD GetName(nsACString& aName) final override
{
aName.AssignLiteral("PluginTimerCallBack");
return NS_OK;
}
private:
nsCOMPtr<nsIContent> mContent;
};
@@ -1329,19 +1337,16 @@ nsAccessibilityService::Init()
#if defined(XP_WIN)
// This information needs to be initialized before the observer fires.
if (XRE_IsParentProcess()) {
Compatibility::Init();
}
#endif // defined(XP_WIN)
- static const char16_t kInitIndicator[] = { '1', 0 };
- observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kInitIndicator);
-
// Subscribe to EventListenerService.
nsCOMPtr<nsIEventListenerService> eventListenerService =
do_GetService("@mozilla.org/eventlistenerservice;1");
if (!eventListenerService)
return false;
eventListenerService->AddListenerChangeListener(this);
@@ -1393,16 +1398,19 @@ nsAccessibilityService::Init()
#endif
// Now its safe to start platform accessibility.
if (XRE_IsParentProcess())
PlatformInit();
statistics::A11yInitialized();
+ static const char16_t kInitIndicator[] = { '1', 0 };
+ observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kInitIndicator);
+
return true;
}
void
nsAccessibilityService::Shutdown()
{
// Application is going to be closed, shutdown accessibility and mark
// accessibility service as shutdown to prevent calls of its methods.
@@ -1412,19 +1420,16 @@ nsAccessibilityService::Shutdown()
MOZ_ASSERT(gConsumers, "Accessibility was shutdown already");
UnsetConsumers(eXPCOM | eMainProcess | ePlatformAPI);
// Remove observers.
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
if (observerService) {
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
-
- static const char16_t kShutdownIndicator[] = { '0', 0 };
- observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kShutdownIndicator);
}
// Stop accessible document loader.
DocManager::Shutdown();
SelectionManager::Shutdown();
#ifdef XP_WIN
@@ -1444,16 +1449,21 @@ nsAccessibilityService::Shutdown()
NS_RELEASE(gApplicationAccessible);
gApplicationAccessible = nullptr;
NS_IF_RELEASE(gXPCApplicationAccessible);
gXPCApplicationAccessible = nullptr;
NS_RELEASE(gAccessibilityService);
gAccessibilityService = nullptr;
+
+ if (observerService) {
+ static const char16_t kShutdownIndicator[] = { '0', 0 };
+ observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kShutdownIndicator);
+ }
}
already_AddRefed<Accessible>
nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
DocAccessible* aDoc)
{
nsAutoString role;
nsCoreUtils::XBLBindingRole(aContent, role);
@@ -1546,18 +1556,20 @@ nsAccessibilityService::CreateAccessible
#endif
accessible = new XULMenupopupAccessible(aContent, aDoc);
} else if(role.EqualsLiteral("xul:pane")) {
accessible = new EnumRoleAccessible<roles::PANE>(aContent, aDoc);
} else if (role.EqualsLiteral("xul:panel")) {
- if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
- nsGkAtoms::_true, eCaseMatters))
+ if (aContent->IsElement() &&
+ aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::noautofocus,
+ nsGkAtoms::_true, eCaseMatters))
accessible = new XULAlertAccessible(aContent, aDoc);
else
accessible = new EnumRoleAccessible<roles::PANE>(aContent, aDoc);
} else if (role.EqualsLiteral("xul:progressmeter")) {
accessible = new XULProgressMeterAccessible(aContent, aDoc);
} else if (role.EqualsLiteral("xul:scale")) {
@@ -1760,25 +1772,32 @@ nsAccessibilityService::MarkupAttributes
for (uint32_t i = 0; i < ArrayLength(markupMap->attrs); i++) {
const MarkupAttrInfo* info = markupMap->attrs + i;
if (!info->name)
break;
if (info->DOMAttrName) {
if (info->DOMAttrValue) {
- if (aContent->AttrValueIs(kNameSpaceID_None, *info->DOMAttrName,
- *info->DOMAttrValue, eCaseMatters)) {
+ if (aContent->IsElement() &&
+ aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ *info->DOMAttrName,
+ *info->DOMAttrValue,
+ eCaseMatters)) {
nsAccUtils::SetAccAttr(aAttributes, *info->name, *info->DOMAttrValue);
}
continue;
}
nsAutoString value;
- aContent->GetAttr(kNameSpaceID_None, *info->DOMAttrName, value);
+
+ if (aContent->IsElement()) {
+ aContent->AsElement()->GetAttr(kNameSpaceID_None, *info->DOMAttrName, value);
+ }
+
if (!value.IsEmpty())
nsAccUtils::SetAccAttr(aAttributes, *info->name, value);
continue;
}
nsAccUtils::SetAccAttr(aAttributes, *info->name, *info->value);
}
--- a/accessible/base/nsAccessiblePivot.cpp
+++ b/accessible/base/nsAccessiblePivot.cpp
@@ -581,18 +581,17 @@ nsAccessiblePivot::MoveToPoint(nsIAccess
if (filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE)
match = nullptr;
// Match if no node below this is a match
if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) {
nsIntRect childRect = child->Bounds();
// Double-check child's bounds since the deepest child may have been out
// of bounds. This assures we don't return a false positive.
- if (aX >= childRect.x && aX < childRect.x + childRect.width &&
- aY >= childRect.y && aY < childRect.y + childRect.height)
+ if (childRect.Contains(aX, aY))
match = child;
}
child = child->Parent();
}
if (match || !aIgnoreNoMatch)
*aResult = MovePivotInternal(match, nsIAccessiblePivot::REASON_POINT,
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -179,32 +179,33 @@ nsCoreUtils::DispatchTouchEvent(EventMes
}
uint32_t
nsCoreUtils::GetAccessKeyFor(nsIContent* aContent)
{
// Accesskeys are registered by @accesskey attribute only. At first check
// whether it is presented on the given element to avoid the slow
// EventStateManager::GetRegisteredAccessKey() method.
- if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
+ if (!aContent->IsElement() ||
+ !aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
return 0;
nsIPresShell* presShell = aContent->OwnerDoc()->GetShell();
if (!presShell)
return 0;
nsPresContext *presContext = presShell->GetPresContext();
if (!presContext)
return 0;
EventStateManager *esm = presContext->EventStateManager();
if (!esm)
return 0;
- return esm->GetRegisteredAccessKey(aContent);
+ return esm->GetRegisteredAccessKey(aContent->AsElement());
}
nsIContent *
nsCoreUtils::GetDOMElementFor(nsIContent *aContent)
{
if (aContent->IsElement())
return aContent;
@@ -220,17 +221,17 @@ nsCoreUtils::GetDOMNodeFromDOMPoint(nsIN
if (aNode && aNode->IsElement()) {
uint32_t childCount = aNode->GetChildCount();
NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!");
// The offset can be after last child of container node that means DOM point
// is placed immediately after the last child. In this case use the DOM node
// from the given DOM point is used as result node.
if (aOffset != childCount)
- return aNode->GetChildAt(aOffset);
+ return aNode->GetChildAt_Deprecated(aOffset);
}
return aNode;
}
bool
nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
nsINode *aPossibleDescendantNode,
@@ -296,17 +297,17 @@ nsCoreUtils::ScrollFrameToPoint(nsIFrame
{
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollableFrame);
if (!scrollableFrame)
return;
nsPoint point =
ToAppUnits(aPoint, aFrame->PresContext()->AppUnitsPerDevPixel());
nsRect frameRect = aFrame->GetScreenRectInAppUnits();
- nsPoint deltaPoint(point.x - frameRect.x, point.y - frameRect.y);
+ nsPoint deltaPoint = point - frameRect.TopLeft();
nsPoint scrollPoint = scrollableFrame->GetScrollPosition();
scrollPoint -= deltaPoint;
scrollableFrame->ScrollTo(scrollPoint, nsIScrollableFrame::INSTANT);
}
void
@@ -450,24 +451,28 @@ nsCoreUtils::IsErrorPage(nsIDocument *aD
NS_NAMED_LITERAL_CSTRING(certerror, "certerror");
return StringBeginsWith(path, neterror) || StringBeginsWith(path, certerror);
}
bool
nsCoreUtils::GetID(nsIContent *aContent, nsAString& aID)
{
- return aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::id, aID);
+ return aContent->IsElement() &&
+ aContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::id, aID);
}
bool
nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsAtom *aAttr, int32_t *aUInt)
{
nsAutoString value;
- aContent->GetAttr(kNameSpaceID_None, aAttr, value);
+ if (!aContent->IsElement()) {
+ return false;
+ }
+ aContent->AsElement()->GetAttr(kNameSpaceID_None, aAttr, value);
if (!value.IsEmpty()) {
nsresult error = NS_OK;
int32_t integer = value.ToInteger(&error);
if (NS_SUCCEEDED(error) && integer > 0) {
*aUInt = integer;
return true;
}
}
@@ -478,17 +483,18 @@ nsCoreUtils::GetUIntAttr(nsIContent *aCo
void
nsCoreUtils::GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent,
nsAString& aLanguage)
{
aLanguage.Truncate();
nsIContent *walkUp = aContent;
while (walkUp && walkUp != aRootContent &&
- !walkUp->GetAttr(kNameSpaceID_None, nsGkAtoms::lang, aLanguage))
+ (!walkUp->IsElement() ||
+ !walkUp->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::lang, aLanguage)))
walkUp = walkUp->GetParent();
}
already_AddRefed<nsIBoxObject>
nsCoreUtils::GetTreeBodyBoxObject(nsITreeBoxObject *aTreeBoxObj)
{
nsCOMPtr<nsIDOMElement> tcElm;
aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
@@ -612,17 +618,17 @@ nsCoreUtils::GetPreviousSensibleColumn(n
return prevColumn.forget();
}
bool
nsCoreUtils::IsColumnHidden(nsITreeColumn *aColumn)
{
nsCOMPtr<nsIDOMElement> element;
aColumn->GetElement(getter_AddRefs(element));
- nsCOMPtr<nsIContent> content = do_QueryInterface(element);
+ nsCOMPtr<Element> content = do_QueryInterface(element);
return content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
nsGkAtoms::_true, eCaseMatters);
}
void
nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
uint32_t aScrollType)
{
@@ -672,14 +678,14 @@ nsCoreUtils::DispatchAccEvent(RefPtr<nsI
obsService->NotifyObservers(event, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
}
void
nsCoreUtils::XBLBindingRole(const nsIContent* aEl, nsAString& aRole)
{
for (const nsXBLBinding* binding = aEl->GetXBLBinding(); binding;
binding = binding->GetBaseBinding()) {
- nsIContent* bindingElm = binding->PrototypeBinding()->GetBindingElement();
+ Element* bindingElm = binding->PrototypeBinding()->GetBindingElement();
bindingElm->GetAttr(kNameSpaceID_None, nsGkAtoms::role, aRole);
if (!aRole.IsEmpty())
break;
}
}
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -2,16 +2,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/. */
#ifndef nsCoreUtils_h_
#define nsCoreUtils_h_
#include "mozilla/EventForwards.h"
+#include "mozilla/dom/Element.h"
#include "nsIAccessibleEvent.h"
#include "nsIContent.h"
#include "nsIDocument.h" // for GetShell()
#include "nsIPresShell.h"
#include "nsPoint.h"
#include "nsTArray.h"
@@ -286,17 +287,18 @@ public:
uint32_t aScrollType);
/**
* Return true if the given node is table header element.
*/
static bool IsHTMLTableHeader(nsIContent *aContent)
{
return aContent->NodeInfo()->Equals(nsGkAtoms::th) ||
- aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scope);
+ (aContent->IsElement() &&
+ aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::scope));
}
/**
* Returns true if the given string is empty or contains whitespace symbols
* only. In contrast to nsWhitespaceTokenizer class it takes into account
* non-breaking space (0xa0).
*/
static bool IsWhitespaceString(const nsAString& aString);
--- a/accessible/base/nsTextEquivUtils.cpp
+++ b/accessible/base/nsTextEquivUtils.cpp
@@ -308,22 +308,22 @@ nsTextEquivUtils::AppendFromDOMNode(nsIC
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl =
do_QueryInterface(aContent);
if (labeledEl) {
labeledEl->GetLabel(textEquivalent);
} else {
if (aContent->NodeInfo()->Equals(nsGkAtoms::label,
kNameSpaceID_XUL))
- aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value,
- textEquivalent);
+ aContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value,
+ textEquivalent);
if (textEquivalent.IsEmpty())
- aContent->GetAttr(kNameSpaceID_None,
- nsGkAtoms::tooltiptext, textEquivalent);
+ aContent->AsElement()->GetAttr(kNameSpaceID_None,
+ nsGkAtoms::tooltiptext, textEquivalent);
}
AppendString(aString, textEquivalent);
}
return AppendFromDOMChildren(aContent, aString);
}
--- a/accessible/generic/ARIAGridAccessible.cpp
+++ b/accessible/generic/ARIAGridAccessible.cpp
@@ -636,21 +636,20 @@ ARIAGridCellAccessible::ApplyARIAState(u
return;
// Check aria-selected="true" on the row.
Accessible* row = Parent();
if (!row || row->Role() != roles::ROW)
return;
nsIContent *rowContent = row->GetContent();
- if (nsAccUtils::HasDefinedARIAToken(rowContent,
- nsGkAtoms::aria_selected) &&
- !rowContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::aria_selected,
- nsGkAtoms::_false, eCaseMatters))
+ if (nsAccUtils::HasDefinedARIAToken(rowContent, nsGkAtoms::aria_selected) &&
+ !rowContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::aria_selected,
+ nsGkAtoms::_false, eCaseMatters))
*aState |= states::SELECTABLE | states::SELECTED;
}
already_AddRefed<nsIPersistentProperties>
ARIAGridCellAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
HyperTextAccessibleWrap::NativeAttributes();
--- a/accessible/generic/Accessible-inl.h
+++ b/accessible/generic/Accessible-inl.h
@@ -71,18 +71,18 @@ Accessible::SetRoleMapEntry(const nsRole
}
inline bool
Accessible::IsSearchbox() const
{
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
return (roleMapEntry && roleMapEntry->Is(nsGkAtoms::searchbox)) ||
(mContent->IsHTMLElement(nsGkAtoms::input) &&
- mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::search, eCaseMatters));
+ mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::search, eCaseMatters));
}
inline bool
Accessible::HasGenericType(AccGenericType aType) const
{
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
return (mGenericTypes & aType) ||
(roleMapEntry && roleMapEntry->IsOfType(aType));
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -148,22 +148,22 @@ Accessible::Name(nsString& aName)
}
ENameValueFlag nameFlag = NativeName(aName);
if (!aName.IsEmpty())
return nameFlag;
// In the end get the name from tooltip.
if (mContent->IsHTMLElement()) {
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aName)) {
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aName)) {
aName.CompressWhitespace();
return eNameFromTooltip;
}
} else if (mContent->IsXULElement()) {
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aName)) {
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aName)) {
aName.CompressWhitespace();
return eNameFromTooltip;
}
} else if (mContent->IsSVGElement()) {
// If user agents need to choose among multiple ‘desc’ or ‘title’ elements
// for processing, the user agent shall choose the first one.
for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
childElm = childElm->GetNextSibling()) {
@@ -197,19 +197,19 @@ Accessible::Description(nsString& aDescr
aDescription);
if (aDescription.IsEmpty()) {
NativeDescription(aDescription);
if (aDescription.IsEmpty()) {
// Keep the Name() method logic.
if (mContent->IsHTMLElement()) {
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aDescription);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aDescription);
} else if (mContent->IsXULElement()) {
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aDescription);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aDescription);
} else if (mContent->IsSVGElement()) {
for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
childElm = childElm->GetNextSibling()) {
if (childElm->IsSVGElement(nsGkAtoms::desc)) {
nsTextEquivUtils::AppendTextEquivFromContent(this, childElm,
&aDescription);
break;
}
@@ -446,17 +446,17 @@ Accessible::NativeState()
else
state |= states::HORIZONTAL;
}
}
}
// Check if a XUL element has the popup attribute (an attached popup menu).
if (HasOwnContent() && mContent->IsXULElement() &&
- mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
+ mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
state |= states::HASPOPUP;
// Bypass the link states specialization for non links.
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
if (!roleMapEntry || roleMapEntry->roleRule == kUseNativeRole ||
roleMapEntry->role == roles::LINK)
state |= NativeLinkState();
@@ -486,18 +486,19 @@ Accessible::NativeLinkState() const
}
bool
Accessible::NativelyUnavailable() const
{
if (mContent->IsHTMLElement())
return mContent->AsElement()->State().HasState(NS_EVENT_STATE_DISABLED);
- return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
- nsGkAtoms::_true, eCaseMatters);
+ return mContent->IsElement() &&
+ mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
+ nsGkAtoms::_true, eCaseMatters);
}
Accessible*
Accessible::FocusedChild()
{
Accessible* focus = FocusMgr()->FocusedAccessible();
if (focus && (focus == this || focus->Parent() == this))
return focus;
@@ -508,18 +509,17 @@ Accessible::FocusedChild()
Accessible*
Accessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
// If we can't find the point in a child, we will return the fallback answer:
// we return |this| if the point is within it, otherwise nullptr.
Accessible* fallbackAnswer = nullptr;
nsIntRect rect = Bounds();
- if (aX >= rect.x && aX < rect.x + rect.width &&
- aY >= rect.y && aY < rect.y + rect.height)
+ if (rect.Contains(aX, aY))
fallbackAnswer = this;
if (nsAccUtils::MustPrune(this)) // Do not dig any further
return fallbackAnswer;
// Search an accessible at the given point starting from accessible document
// because containing block (see CSS2) for out of flow element (for example,
// absolutely positioned element) may be different from its DOM parent and
@@ -537,17 +537,17 @@ Accessible::ChildAtPoint(int32_t aX, int
// Check whether the point is at popup content.
nsIWidget* rootWidget = rootFrame->GetView()->GetNearestWidget(nullptr);
NS_ENSURE_TRUE(rootWidget, nullptr);
LayoutDeviceIntRect rootRect = rootWidget->GetScreenBounds();
WidgetMouseEvent dummyEvent(true, eMouseMove, rootWidget,
WidgetMouseEvent::eSynthesized);
- dummyEvent.mRefPoint = LayoutDeviceIntPoint(aX - rootRect.x, aY - rootRect.y);
+ dummyEvent.mRefPoint = LayoutDeviceIntPoint(aX - rootRect.X(), aY - rootRect.Y());
nsIFrame* popupFrame = nsLayoutUtils::
GetPopupFrameForEventCoordinates(accDocument->PresContext()->GetRootPresContext(),
&dummyEvent);
if (popupFrame) {
// If 'this' accessible is not inside the popup then ignore the popup when
// searching an accessible at point.
DocAccessible* popupDoc =
@@ -559,18 +559,18 @@ Accessible::ChildAtPoint(int32_t aX, int
popupChild = popupChild->Parent();
if (popupChild == popupAcc)
startFrame = popupFrame;
}
nsPresContext* presContext = startFrame->PresContext();
nsRect screenRect = startFrame->GetScreenRectInAppUnits();
- nsPoint offset(presContext->DevPixelsToAppUnits(aX) - screenRect.x,
- presContext->DevPixelsToAppUnits(aY) - screenRect.y);
+ nsPoint offset(presContext->DevPixelsToAppUnits(aX) - screenRect.X(),
+ presContext->DevPixelsToAppUnits(aY) - screenRect.Y());
nsIFrame* foundFrame = nsLayoutUtils::GetFrameForPoint(startFrame, offset);
nsIContent* content = nullptr;
if (!foundFrame || !(content = foundFrame->GetContent()))
return fallbackAnswer;
// Get accessible for the node with the point or the first accessible in
// the DOM parent chain.
@@ -611,18 +611,17 @@ Accessible::ChildAtPoint(int32_t aX, int
// where layout won't walk into things for us, such as image map areas and
// sub documents (XXX: subdocuments should be handled by methods of
// OuterDocAccessibles).
uint32_t childCount = accessible->ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = accessible->GetChildAt(childIdx);
nsIntRect childRect = child->Bounds();
- if (aX >= childRect.x && aX < childRect.x + childRect.width &&
- aY >= childRect.y && aY < childRect.y + childRect.height &&
+ if (childRect.Contains(aX, aY) &&
(child->State() & states::INVISIBLE) == 0) {
if (aWhichChild == eDeepestChild)
return child->ChildAtPoint(aX, aY, eDeepestChild);
return child;
}
}
@@ -675,27 +674,26 @@ Accessible::Bounds() const
{
nsIFrame* boundingFrame = nullptr;
nsRect unionRectTwips = RelativeBounds(&boundingFrame);
if (!boundingFrame)
return nsIntRect();
nsIntRect screenRect;
nsPresContext* presContext = mDoc->PresContext();
- screenRect.x = presContext->AppUnitsToDevPixels(unionRectTwips.x);
- screenRect.y = presContext->AppUnitsToDevPixels(unionRectTwips.y);
- screenRect.width = presContext->AppUnitsToDevPixels(unionRectTwips.width);
- screenRect.height = presContext->AppUnitsToDevPixels(unionRectTwips.height);
+ screenRect.SetRect(presContext->AppUnitsToDevPixels(unionRectTwips.X()),
+ presContext->AppUnitsToDevPixels(unionRectTwips.Y()),
+ presContext->AppUnitsToDevPixels(unionRectTwips.Width()),
+ presContext->AppUnitsToDevPixels(unionRectTwips.Height()));
// We have the union of the rectangle, now we need to put it in absolute
// screen coords.
nsIntRect orgRectPixels = boundingFrame->GetScreenRectInAppUnits().
ToNearestPixels(presContext->AppUnitsPerDevPixel());
- screenRect.x += orgRectPixels.x;
- screenRect.y += orgRectPixels.y;
+ screenRect.MoveBy(orgRectPixels.X(), orgRectPixels.Y());
return screenRect;
}
void
Accessible::SetSelected(bool aSelect)
{
if (!HasOwnContent())
@@ -822,19 +820,20 @@ Accessible::XULElmName(DocAccessible* aD
// Can get text from title of <toolbaritem> if we're a child of a <toolbaritem>
nsIContent *bindingParent = aElm->GetBindingParent();
nsIContent* parent =
bindingParent? bindingParent->GetParent() : aElm->GetParent();
nsAutoString ancestorTitle;
while (parent) {
if (parent->IsXULElement(nsGkAtoms::toolbaritem) &&
- parent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, ancestorTitle)) {
+ parent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::title, ancestorTitle)) {
// Before returning this, check if the element itself has a tooltip:
- if (aElm->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aName)) {
+ if (aElm->IsElement() &&
+ aElm->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aName)) {
aName.CompressWhitespace();
return;
}
aName.Assign(ancestorTitle);
aName.CompressWhitespace();
return;
}
@@ -939,17 +938,17 @@ Accessible::Attributes()
// 'xml-roles' attribute for landmark.
nsAtom* landmark = LandmarkRole();
if (landmark) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::xmlroles, landmark);
} else {
// 'xml-roles' attribute coming from ARIA.
nsAutoString xmlRoles;
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::role, xmlRoles))
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::role, xmlRoles))
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::xmlroles, xmlRoles);
}
// Expose object attributes from ARIA attributes.
nsAutoString unused;
aria::AttrIterator attribIter(mContent);
nsAutoString name, value;
while(attribIter.Next(name, value))
@@ -1060,17 +1059,17 @@ Accessible::NativeAttributes()
return attributes.forget();
nsAutoString id;
if (nsCoreUtils::GetID(mContent, id))
attributes->SetStringProperty(NS_LITERAL_CSTRING("id"), id, unused);
// Expose class because it may have useful microformat information.
nsAutoString _class;
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, _class))
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, _class))
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::_class, _class);
// Expose tag.
nsAutoString tagName;
mContent->NodeInfo()->GetName(tagName);
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tag, tagName);
// Expose draggable object attribute.
@@ -1174,19 +1173,20 @@ Accessible::State()
// Apply ARIA states to be sure accessible states will be overridden.
ApplyARIAState(&state);
// If this is an ARIA item of the selectable widget and if it's focused and
// not marked unselected explicitly (i.e. aria-selected="false") then expose
// it as selected to make ARIA widget authors life easier.
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
if (roleMapEntry && !(state & states::SELECTED) &&
- !mContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::aria_selected,
- nsGkAtoms::_false, eCaseMatters)) {
+ (!mContent->IsElement() ||
+ !mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::aria_selected,
+ nsGkAtoms::_false, eCaseMatters))) {
// Special case for tabs: focused tab or focus inside related tab panel
// implies selected state.
if (roleMapEntry->role == roles::PAGETAB) {
if (state & states::FOCUSED) {
state |= states::SELECTED;
} else {
// If focus is in a child of the tab panel surely the tab is selected!
Relation rel = RelationByType(RelationType::LABEL_FOR);
@@ -1334,20 +1334,24 @@ Accessible::Value(nsString& aValue)
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
if (!roleMapEntry)
return;
if (roleMapEntry->valueRule != eNoValue) {
// aria-valuenow is a number, and aria-valuetext is the optional text
// equivalent. For the string value, we will try the optional text
// equivalent first.
- if (!mContent->GetAttr(kNameSpaceID_None,
- nsGkAtoms::aria_valuetext, aValue)) {
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow,
- aValue);
+ if (!mContent->IsElement()) {
+ return;
+ }
+
+ if (!mContent->AsElement()->GetAttr(kNameSpaceID_None,
+ nsGkAtoms::aria_valuetext, aValue)) {
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow,
+ aValue);
}
return;
}
// Value of textbox is a textified subtree.
if (roleMapEntry->Is(nsGkAtoms::textbox)) {
nsTextEquivUtils::GetTextEquivFromSubtree(this, aValue);
return;
@@ -1449,20 +1453,21 @@ Accessible::ARIATransformRole(role aRole
// where the accessible role depends on both the role and ARIA state.
if (aRole == roles::PUSHBUTTON) {
if (nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_pressed)) {
// For simplicity, any existing pressed attribute except "" or "undefined"
// indicates a toggle.
return roles::TOGGLE_BUTTON;
}
- if (mContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::aria_haspopup,
- nsGkAtoms::_true,
- eCaseMatters)) {
+ if (mContent->IsElement() &&
+ mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::aria_haspopup,
+ nsGkAtoms::_true,
+ eCaseMatters)) {
// For button with aria-haspopup="true".
return roles::BUTTONMENU;
}
} else if (aRole == roles::LISTBOX) {
// A listbox inside of a combobox needs a special role because of ATK
// mapping to menu.
if (mParent && mParent->IsCombobox()) {
@@ -1477,18 +1482,19 @@ Accessible::ARIATransformRole(role aRole
}
} else if (aRole == roles::OPTION) {
if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
return roles::COMBOBOX_OPTION;
} else if (aRole == roles::MENUITEM) {
// Menuitem has a submenu.
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_haspopup,
- nsGkAtoms::_true, eCaseMatters)) {
+ if (mContent->IsElement() &&
+ mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_haspopup,
+ nsGkAtoms::_true, eCaseMatters)) {
return roles::PARENT_MENUITEM;
}
}
return aRole;
}
nsAtom*
@@ -1592,17 +1598,20 @@ Accessible::DoAction(uint8_t aIndex)
return false;
}
nsIContent*
Accessible::GetAtomicRegion() const
{
nsIContent *loopContent = mContent;
nsAutoString atomic;
- while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_atomic, atomic))
+ while (loopContent &&
+ (!loopContent->IsElement() ||
+ !loopContent->AsElement()->GetAttr(kNameSpaceID_None,
+ nsGkAtoms::aria_atomic, atomic)))
loopContent = loopContent->GetParent();
return atomic.EqualsLiteral("true") ? loopContent : nullptr;
}
Relation
Accessible::RelationByType(RelationType aType)
{
@@ -1982,17 +1991,19 @@ Accessible::ARIAName(nsString& aName)
// aria-labelledby now takes precedence over aria-label
nsresult rv = nsTextEquivUtils::
GetTextEquivFromIDRefs(this, nsGkAtoms::aria_labelledby, aName);
if (NS_SUCCEEDED(rv)) {
aName.CompressWhitespace();
}
if (aName.IsEmpty() &&
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_label, aName)) {
+ mContent->IsElement() &&
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_label,
+ aName)) {
aName.CompressWhitespace();
}
}
// Accessible protected
ENameValueFlag
Accessible::NativeName(nsString& aName)
{
@@ -2539,30 +2550,32 @@ Accessible::IsActiveWidget() const
return false;
}
bool
Accessible::AreItemsOperable() const
{
return HasOwnContent() &&
- mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant);
+ mContent->IsElement() &&
+ mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant);
}
Accessible*
Accessible::CurrentItem()
{
// Check for aria-activedescendant, which changes which element has focus.
// For activedescendant, the ARIA spec does not require that the user agent
// checks whether pointed node is actually a DOM descendant of the element
// with the aria-activedescendant attribute.
nsAutoString id;
if (HasOwnContent() &&
- mContent->GetAttr(kNameSpaceID_None,
- nsGkAtoms::aria_activedescendant, id)) {
+ mContent->IsElement() &&
+ mContent->AsElement()->GetAttr(kNameSpaceID_None,
+ nsGkAtoms::aria_activedescendant, id)) {
nsIDocument* DOMDoc = mContent->OwnerDoc();
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
if (activeDescendantElm) {
DocAccessible* document = Document();
if (document)
return document->GetAccessible(activeDescendantElm);
}
}
@@ -2585,18 +2598,19 @@ Accessible::SetCurrentItem(Accessible* a
Accessible*
Accessible::ContainerWidget() const
{
if (HasARIARole() && mContent->HasID()) {
for (Accessible* parent = Parent(); parent; parent = parent->Parent()) {
nsIContent* parentContent = parent->GetContent();
if (parentContent &&
- parentContent->HasAttr(kNameSpaceID_None,
- nsGkAtoms::aria_activedescendant)) {
+ parentContent->IsElement() &&
+ parentContent->AsElement()->HasAttr(kNameSpaceID_None,
+ nsGkAtoms::aria_activedescendant)) {
return parent;
}
// Don't cross DOM document boundaries.
if (parent->IsDoc())
break;
}
}
@@ -2659,33 +2673,34 @@ Accessible::GetSiblingAtOffset(int32_t a
double
Accessible::AttrNumericValue(nsAtom* aAttr) const
{
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
if (!roleMapEntry || roleMapEntry->valueRule == eNoValue)
return UnspecifiedNaN<double>();
nsAutoString attrValue;
- if (!mContent->GetAttr(kNameSpaceID_None, aAttr, attrValue))
+ if (!mContent->IsElement() ||
+ !mContent->AsElement()->GetAttr(kNameSpaceID_None, aAttr, attrValue))
return UnspecifiedNaN<double>();
nsresult error = NS_OK;
double value = attrValue.ToDouble(&error);
return NS_FAILED(error) ? UnspecifiedNaN<double>() : value;
}
uint32_t
Accessible::GetActionRule() const
{
if (!HasOwnContent() || (InteractiveState() & states::UNAVAILABLE))
return eNoAction;
// Return "click" action on elements that have an attached popup menu.
if (mContent->IsXULElement())
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
return eClickAction;
// Has registered 'click' event handler.
bool isOnclick = nsCoreUtils::HasClickListener(mContent);
if (isOnclick)
return eClickAction;
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -18,17 +18,16 @@
#include "RootAccessible.h"
#include "TreeWalker.h"
#include "xpcAccessibleDocument.h"
#include "nsIMutableArray.h"
#include "nsICommandManager.h"
#include "nsIDocShell.h"
#include "nsIDocument.h"
-#include "nsIDOMAttr.h"
#include "nsIDOMCharacterData.h"
#include "nsIDOMDocument.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsPIDOMWindow.h"
#include "nsIEditingSession.h"
#include "nsIFrame.h"
#include "nsIInterfaceRequestorUtils.h"
@@ -870,17 +869,17 @@ DocAccessible::AttributeChangedImpl(Acce
return;
}
if (aAttribute == nsGkAtoms::aria_describedby) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE, aAccessible);
return;
}
- nsIContent* elm = aAccessible->GetContent();
+ dom::Element* elm = aAccessible->GetContent()->AsElement();
if (aAttribute == nsGkAtoms::aria_labelledby &&
!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_label)) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, aAccessible);
return;
}
if (aAttribute == nsGkAtoms::alt &&
!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_label) &&
@@ -991,17 +990,17 @@ DocAccessible::ARIAAttributeChanged(Acce
// change event; at least until native API comes up with a more meaningful event.
uint8_t attrFlags = aria::AttrCharacteristicsFor(aAttribute);
if (!(attrFlags & ATTR_BYPASSOBJ)) {
RefPtr<AccEvent> event =
new AccObjectAttrChangedEvent(aAccessible, aAttribute);
FireDelayedEvent(event);
}
- nsIContent* elm = aAccessible->GetContent();
+ dom::Element* elm = aAccessible->GetContent()->AsElement();
// Update aria-hidden flag for the whole subtree iff aria-hidden is changed
// on the root, i.e. ignore any affiliated aria-hidden changes in the subtree
// of top aria-hidden.
if (aAttribute == nsGkAtoms::aria_hidden) {
bool isDefined = aria::HasDefinedARIAHidden(elm);
if (isDefined != aAccessible->IsARIAHidden() &&
(!aAccessible->Parent() || !aAccessible->Parent()->IsARIAHidden())) {
@@ -1067,19 +1066,21 @@ DocAccessible::ARIAAttributeChanged(Acce
mNotificationController->ScheduleRelocation(aAccessible);
}
}
void
DocAccessible::ARIAActiveDescendantChanged(Accessible* aAccessible)
{
nsIContent* elm = aAccessible->GetContent();
- if (elm && aAccessible->IsActiveWidget()) {
+ if (elm && elm->IsElement() && aAccessible->IsActiveWidget()) {
nsAutoString id;
- if (elm->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, id)) {
+ if (elm->AsElement()->GetAttr(kNameSpaceID_None,
+ nsGkAtoms::aria_activedescendant,
+ id)) {
dom::Element* activeDescendantElm = elm->OwnerDoc()->GetElementById(id);
if (activeDescendantElm) {
Accessible* activeDescendant = GetAccessible(activeDescendantElm);
if (activeDescendant) {
FocusMgr()->ActiveItemChanged(activeDescendant, false);
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eFocus))
logging::ActiveItemChangeCausedBy("ARIA activedescedant changed",
@@ -1244,36 +1245,24 @@ DocAccessible::GetAccessibleByUniqueIDIn
}
Accessible*
DocAccessible::GetAccessibleOrContainer(nsINode* aNode) const
{
if (!aNode || !aNode->GetComposedDoc())
return nullptr;
- nsINode* currNode = aNode;
- Accessible* accessible = nullptr;
- while (!(accessible = GetAccessible(currNode))) {
- nsINode* parent = nullptr;
-
- // If this is a content node, try to get a flattened parent content node.
- // This will smartly skip from the shadow root to the host element,
- // over parentless document fragment
- if (currNode->IsContent())
- parent = currNode->AsContent()->GetFlattenedTreeParent();
-
- // Fallback to just get parent node, in case there is no parent content
- // node. Or current node is not a content node.
- if (!parent)
- parent = currNode->GetParentNode();
-
- if (!(currNode = parent)) break;
+ for (nsINode* currNode = aNode; currNode;
+ currNode = currNode->GetFlattenedTreeParentNode()) {
+ if (Accessible* accessible = GetAccessible(currNode)) {
+ return accessible;
+ }
}
- return accessible;
+ return nullptr;
}
Accessible*
DocAccessible::GetAccessibleOrDescendant(nsINode* aNode) const
{
Accessible* acc = GetAccessible(aNode);
if (acc)
return acc;
@@ -1306,18 +1295,19 @@ DocAccessible::BindToDocument(Accessible
// Put into unique ID cache.
mAccessibleCache.Put(aAccessible->UniqueID(), aAccessible);
aAccessible->SetRoleMapEntry(aRoleMapEntry);
if (aAccessible->HasOwnContent()) {
AddDependentIDsFor(aAccessible);
- nsIContent* el = aAccessible->GetContent();
- if (el->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_owns)) {
+ nsIContent* content = aAccessible->GetContent();
+ if (content->IsElement() &&
+ content->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_owns)) {
mNotificationController->ScheduleRelocation(aAccessible);
}
}
}
void
DocAccessible::UnbindFromDocument(Accessible* aAccessible)
{
@@ -1848,16 +1838,17 @@ InsertIterator::Next()
return true;
}
}
else {
TreeWalker finder(container);
if (finder.Seek(node)) {
mChild = mWalker.Scope(node);
if (mChild) {
+ MOZ_ASSERT(!mChild->IsRelocated(), "child cannot be aria owned");
mChildBefore = finder.Prev();
return true;
}
}
}
}
return false;
@@ -2207,17 +2198,18 @@ DocAccessible::PutChildrenBack(nsTArray<
"old parent", owner, "child", child, nullptr);
#endif
// Unset relocated flag to find an insertion point for the child.
child->SetRelocated(false);
nsIContent* content = child->GetContent();
int32_t idxInParent = -1;
- Accessible* origContainer = AccessibleOrTrueContainer(content->GetParentNode());
+ Accessible* origContainer =
+ AccessibleOrTrueContainer(content->GetFlattenedTreeParentNode());
if (origContainer) {
TreeWalker walker(origContainer);
if (walker.Seek(content)) {
Accessible* prevChild = walker.Prev();
if (prevChild) {
idxInParent = prevChild->IndexInParent() + 1;
MOZ_DIAGNOSTIC_ASSERT(origContainer == prevChild->Parent(), "Broken tree");
origContainer = prevChild->Parent();
--- a/accessible/generic/FormControlAccessible.cpp
+++ b/accessible/generic/FormControlAccessible.cpp
@@ -35,17 +35,17 @@ ProgressMeterAccessible<Max>::NativeRole
template<int Max>
uint64_t
ProgressMeterAccessible<Max>::NativeState()
{
uint64_t state = LeafAccessible::NativeState();
// An undetermined progressbar (i.e. without a value) has a mixed state.
nsAutoString attrValue;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
if (attrValue.IsEmpty())
state |= states::MIXED;
return state;
}
////////////////////////////////////////////////////////////////////////////////
@@ -89,17 +89,17 @@ template<int Max>
double
ProgressMeterAccessible<Max>::MaxValue() const
{
double value = LeafAccessible::MaxValue();
if (!IsNaN(value))
return value;
nsAutoString strValue;
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::max, strValue)) {
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::max, strValue)) {
nsresult result = NS_OK;
value = strValue.ToDouble(&result);
if (NS_SUCCEEDED(result))
return value;
}
return Max;
}
@@ -124,17 +124,17 @@ template<int Max>
double
ProgressMeterAccessible<Max>::CurValue() const
{
double value = LeafAccessible::CurValue();
if (!IsNaN(value))
return value;
nsAutoString attrValue;
- if (!mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue))
+ if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue))
return UnspecifiedNaN<double>();
nsresult error = NS_OK;
value = attrValue.ToDouble(&error);
return NS_FAILED(error) ? UnspecifiedNaN<double>() : value;
}
template<int Max>
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -136,18 +136,18 @@ HyperTextAccessible::GetBoundsInFrame(ns
rv = frame->GetPointFromOffset(startContentOffset, &frameTextStartPoint);
NS_ENSURE_SUCCESS(rv, nsIntRect());
// Use the point for the end offset to calculate the width
nsPoint frameTextEndPoint;
rv = frame->GetPointFromOffset(startContentOffset + frameSubStringLength, &frameTextEndPoint);
NS_ENSURE_SUCCESS(rv, nsIntRect());
- frameScreenRect.x += std::min(frameTextStartPoint.x, frameTextEndPoint.x);
- frameScreenRect.width = mozilla::Abs(frameTextStartPoint.x - frameTextEndPoint.x);
+ frameScreenRect.SetRectX(frameScreenRect.X() + std::min(frameTextStartPoint.x, frameTextEndPoint.x),
+ mozilla::Abs(frameTextStartPoint.x - frameTextEndPoint.x));
screenRect.UnionRect(frameScreenRect, screenRect);
// Get ready to loop back for next frame continuation
startContentOffset += frameSubStringLength;
startContentOffsetInFrame = 0;
frame = frame->GetNextContinuation();
}
@@ -237,17 +237,17 @@ HyperTextAccessible::DOMPointToOffset(ns
// findNode could be null if aNodeOffset == # of child nodes, which means
// one of two things:
// 1) there are no children, and the passed-in node is not mContent -- use
// parentContent for the node to find
// 2) there are no children and the passed-in node is mContent, which means
// we're an empty nsIAccessibleText
// 3) there are children and we're at the end of the children
- findNode = aNode->GetChildAt(aNodeOffset);
+ findNode = aNode->GetChildAt_Deprecated(aNodeOffset);
if (!findNode) {
if (aNodeOffset == 0) {
if (aNode == GetNode()) {
// Case #1: this accessible has no children and thus has empty text,
// we can only be at hypertext offset 0.
return 0;
}
@@ -264,22 +264,21 @@ HyperTextAccessible::DOMPointToOffset(ns
}
}
// Get accessible for this findNode, or if that node isn't accessible, use the
// accessible for the next DOM node which has one (based on forward depth first search)
Accessible* descendant = nullptr;
if (findNode) {
nsCOMPtr<nsIContent> findContent(do_QueryInterface(findNode));
- if (findContent && findContent->IsHTMLElement() &&
- findContent->NodeInfo()->Equals(nsGkAtoms::br) &&
- findContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::mozeditorbogusnode,
- nsGkAtoms::_true,
- eIgnoreCase)) {
+ if (findContent && findContent->IsHTMLElement(nsGkAtoms::br) &&
+ findContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::mozeditorbogusnode,
+ nsGkAtoms::_true,
+ eIgnoreCase)) {
// This <br> is the hacky "bogus node" used when there is no text in a control
return 0;
}
descendant = mDoc->GetAccessible(findNode);
if (!descendant && findNode->IsContent()) {
Accessible* container = mDoc->GetContainerAccessible(findNode);
if (container) {
@@ -424,17 +423,17 @@ HyperTextAccessible::OffsetToDOMPoint(in
innerOffset = 1;
}
// Case of embedded object. The point is either before or after the element.
NS_ASSERTION(innerOffset == 0 || innerOffset == 1, "A wrong inner offset!");
nsINode* node = child->GetNode();
nsINode* parentNode = node->GetParentNode();
return parentNode ?
- DOMPoint(parentNode, parentNode->IndexOf(node) + innerOffset) :
+ DOMPoint(parentNode, parentNode->ComputeIndexOf(node) + innerOffset) :
DOMPoint();
}
DOMPoint
HyperTextAccessible::ClosestNotGeneratedDOMPoint(const DOMPoint& aDOMPoint,
nsIContent* aElementContent)
{
MOZ_ASSERT(aDOMPoint.node, "The node must not be null");
@@ -1173,18 +1172,18 @@ HyperTextAccessible::OffsetAtPoint(int32
nsPresContext* presContext = mDoc->PresContext();
nsPoint coordsInAppUnits =
ToAppUnits(coords, presContext->AppUnitsPerDevPixel());
nsRect frameScreenRect = hyperFrame->GetScreenRectInAppUnits();
if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y))
return -1; // Not found
- nsPoint pointInHyperText(coordsInAppUnits.x - frameScreenRect.x,
- coordsInAppUnits.y - frameScreenRect.y);
+ nsPoint pointInHyperText(coordsInAppUnits.x - frameScreenRect.X(),
+ coordsInAppUnits.y - frameScreenRect.Y());
// Go through the frames to check if each one has the point.
// When one does, add up the character offsets until we have a match
// We have an point in an accessible child of this, now we need to add up the
// offsets before it to what we already have
int32_t offset = 0;
uint32_t childCount = ChildCount();
@@ -1263,17 +1262,20 @@ HyperTextAccessible::TextBounds(int32_t
bounds.UnionRect(bounds, GetBoundsInFrame(frame, offset1,
nextOffset - prevOffset));
prevOffset = nextOffset;
offset1 = 0;
}
- nsAccUtils::ConvertScreenCoordsTo(&bounds.x, &bounds.y, aCoordType, this);
+ auto boundsX = bounds.X();
+ auto boundsY = bounds.Y();
+ nsAccUtils::ConvertScreenCoordsTo(&boundsX, &boundsY, aCoordType, this);
+ bounds.MoveTo(boundsX, boundsY);
return bounds;
}
already_AddRefed<TextEditor>
HyperTextAccessible::GetEditor() const
{
if (!mContent->HasFlag(NODE_IS_EDITABLE)) {
// If we're inside an editable container, then return that container's editor
@@ -1518,18 +1520,17 @@ HyperTextAccessible::GetCaretRect(nsIWid
// Correct for character size, so that caret always matches the size of
// the character. This is important for font size transitions, and is
// necessary because the Gecko caret uses the previous character's size as
// the user moves forward in the text by character.
nsIntRect charRect = CharBounds(CaretOffset(),
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
if (!charRect.IsEmpty()) {
- caretRect.height -= charRect.y - caretRect.y;
- caretRect.y = charRect.y;
+ caretRect.SetTopEdge(charRect.Y());
}
return caretRect;
}
void
HyperTextAccessible::GetSelectionDOMRanges(SelectionType aSelectionType,
nsTArray<nsRange*>* aRanges)
{
@@ -1710,18 +1711,18 @@ HyperTextAccessible::ScrollSubstringToPo
nsIFrame *parentFrame = frame;
while ((parentFrame = parentFrame->GetParent())) {
nsIScrollableFrame *scrollableFrame = do_QueryFrame(parentFrame);
if (scrollableFrame) {
if (!initialScrolled) {
// Scroll substring to the given point. Turn the point into percents
// relative scrollable area to use nsCoreUtils::ScrollSubstringTo.
nsRect frameRect = parentFrame->GetScreenRectInAppUnits();
- nscoord offsetPointX = coordsInAppUnits.x - frameRect.x;
- nscoord offsetPointY = coordsInAppUnits.y - frameRect.y;
+ nscoord offsetPointX = coordsInAppUnits.x - frameRect.X();
+ nscoord offsetPointY = coordsInAppUnits.y - frameRect.Y();
nsSize size(parentFrame->GetSize());
// avoid divide by zero
size.width = size.width ? size.width : 1;
size.height = size.height ? size.height : 1;
int16_t hPercent = offsetPointX * 100 / size.width;
@@ -1847,30 +1848,31 @@ HyperTextAccessible::RangeAtPoint(int32_
// Accessible protected
ENameValueFlag
HyperTextAccessible::NativeName(nsString& aName)
{
// Check @alt attribute for invalid img elements.
bool hasImgAlt = false;
if (mContent->IsHTMLElement(nsGkAtoms::img)) {
- hasImgAlt = mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName);
+ hasImgAlt =
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName);
if (!aName.IsEmpty())
return eNameOK;
}
ENameValueFlag nameFlag = AccessibleWrap::NativeName(aName);
if (!aName.IsEmpty())
return nameFlag;
// Get name from title attribute for HTML abbr and acronym elements making it
// a valid name from markup. Otherwise their name isn't picked up by recursive
// name computation algorithm. See NS_OK_NAME_FROM_TOOLTIP.
if (IsAbbreviation() &&
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aName))
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aName))
aName.CompressWhitespace();
return hasImgAlt ? eNoNameOnPurpose : eNameOK;
}
void
HyperTextAccessible::Shutdown()
{
@@ -2074,17 +2076,17 @@ HyperTextAccessible::GetDOMPointByFrameO
NS_ASSERTION(!aAccessible->IsDoc(),
"Shouldn't be called on document accessible!");
nsIContent* content = aAccessible->GetContent();
NS_ASSERTION(content, "Shouldn't operate on defunct accessible!");
nsIContent* parent = content->GetParent();
- aPoint->idx = parent->IndexOf(content) + 1;
+ aPoint->idx = parent->ComputeIndexOf(content) + 1;
aPoint->node = parent;
} else if (aFrame->IsTextFrame()) {
nsIContent* content = aFrame->GetContent();
NS_ENSURE_STATE(content);
nsIFrame *primaryFrame = content->GetPrimaryFrame();
nsresult rv = RenderedToContentOffset(primaryFrame, aOffset, &(aPoint->idx));
@@ -2094,17 +2096,17 @@ HyperTextAccessible::GetDOMPointByFrameO
} else {
nsIContent* content = aFrame->GetContent();
NS_ENSURE_STATE(content);
nsIContent* parent = content->GetParent();
NS_ENSURE_STATE(parent);
- aPoint->idx = parent->IndexOf(content);
+ aPoint->idx = parent->ComputeIndexOf(content);
aPoint->node = parent;
}
return NS_OK;
}
// HyperTextAccessible
void
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -69,17 +69,17 @@ ImageAccessible::NativeState()
return state;
}
ENameValueFlag
ImageAccessible::NativeName(nsString& aName)
{
bool hasAltAttrib =
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName);
if (!aName.IsEmpty())
return eNameOK;
ENameValueFlag nameFlag = Accessible::NativeName(aName);
if (!aName.IsEmpty())
return nameFlag;
// No accessible name but empty 'alt' attribute is present. If further name
@@ -143,52 +143,52 @@ ImageAccessible::DoAction(uint8_t aIndex
}
////////////////////////////////////////////////////////////////////////////////
// ImageAccessible
nsIntPoint
ImageAccessible::Position(uint32_t aCoordType)
{
- nsIntRect rect = Bounds();
- nsAccUtils::ConvertScreenCoordsTo(&rect.x, &rect.y, aCoordType, this);
- return rect.TopLeft();
+ nsIntPoint point = Bounds().TopLeft();
+ nsAccUtils::ConvertScreenCoordsTo(&point.x, &point.y, aCoordType, this);
+ return point;
}
nsIntSize
ImageAccessible::Size()
{
return Bounds().Size();
}
// Accessible
already_AddRefed<nsIPersistentProperties>
ImageAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
LinkableAccessible::NativeAttributes();
nsAutoString src;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src);
if (!src.IsEmpty())
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::src, src);
return attributes.forget();
}
////////////////////////////////////////////////////////////////////////////////
// Private methods
already_AddRefed<nsIURI>
ImageAccessible::GetLongDescURI() const
{
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::longdesc)) {
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::longdesc)) {
// To check if longdesc contains an invalid url.
nsAutoString longdesc;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::longdesc, longdesc);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::longdesc, longdesc);
if (longdesc.FindChar(' ') != -1 || longdesc.FindChar('\t') != -1 ||
longdesc.FindChar('\r') != -1 || longdesc.FindChar('\n') != -1) {
return nullptr;
}
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
nsCOMPtr<nsIURI> uri;
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(uri), longdesc,
mContent->OwnerDoc(), baseURI);
@@ -196,17 +196,17 @@ ImageAccessible::GetLongDescURI() const
}
DocAccessible* document = Document();
if (document) {
IDRefsIterator iter(document, mContent, nsGkAtoms::aria_describedby);
while (nsIContent* target = iter.NextElem()) {
if ((target->IsHTMLElement(nsGkAtoms::a) ||
target->IsHTMLElement(nsGkAtoms::area)) &&
- target->HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
+ target->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
nsGenericHTMLElement* element =
nsGenericHTMLElement::FromContent(target);
nsCOMPtr<nsIURI> uri;
element->GetURIAttr(nsGkAtoms::href, nullptr, getter_AddRefs(uri));
return uri.forget();
}
}
--- a/accessible/generic/OuterDocAccessible.cpp
+++ b/accessible/generic/OuterDocAccessible.cpp
@@ -65,18 +65,17 @@ OuterDocAccessible::NativeRole()
return roles::INTERNAL_FRAME;
}
Accessible*
OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
nsIntRect docRect = Bounds();
- if (aX < docRect.x || aX >= docRect.x + docRect.width ||
- aY < docRect.y || aY >= docRect.y + docRect.height)
+ if (!docRect.Contains(aX, aY))
return nullptr;
// Always return the inner doc as direct child accessible unless bounds
// outside of it.
Accessible* child = GetChildAt(0);
NS_ENSURE_TRUE(child, nullptr);
if (aWhichChild == eDeepestChild)
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -126,19 +126,19 @@ void
HTMLRadioButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet,
int32_t* aSetSize)
{
int32_t namespaceId = mContent->NodeInfo()->NamespaceID();
nsAutoString tagName;
mContent->NodeInfo()->GetName(tagName);
nsAutoString type;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
nsAutoString name;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
RefPtr<nsContentList> inputElms;
nsCOMPtr<nsIFormControl> formControlNode(do_QueryInterface(mContent));
dom::Element* formElm = formControlNode->GetFormElement();
if (formElm)
inputElms = NS_GetContentList(formElm, namespaceId, tagName);
else
@@ -148,20 +148,21 @@ HTMLRadioButtonAccessible::GetPositionAn
uint32_t inputCount = inputElms->Length(false);
// Compute posinset and setsize.
int32_t indexOf = 0;
int32_t count = 0;
for (uint32_t index = 0; index < inputCount; index++) {
nsIContent* inputElm = inputElms->Item(index, false);
- if (inputElm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- type, eCaseMatters) &&
- inputElm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
- name, eCaseMatters) && mDoc->HasAccessible(inputElm)) {
+ if (inputElm->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ type, eCaseMatters) &&
+ inputElm->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
+ name, eCaseMatters) &&
+ mDoc->HasAccessible(inputElm)) {
count++;
if (inputElm == mContent)
indexOf = count;
}
}
*aPosInSet = indexOf;
*aSetSize = count;
@@ -247,22 +248,22 @@ HTMLButtonAccessible::NativeName(nsStrin
// element that has no valid @src (note if input@type="image" has an image
// then neither @alt nor @value attributes are used to generate a visual label
// and thus we need to obtain the accessible name directly from attribute
// value). Also the same algorithm works in case of default labels for
// type="submit"/"reset"/"image" elements.
ENameValueFlag nameFlag = Accessible::NativeName(aName);
if (!aName.IsEmpty() || !mContent->IsHTMLElement(nsGkAtoms::input) ||
- !mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::image, eCaseMatters))
+ !mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::image, eCaseMatters))
return nameFlag;
- if (!mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName))
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
+ if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName))
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
aName.CompressWhitespace();
return eNameOK;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLButtonAccessible: Widgets
@@ -285,34 +286,34 @@ HTMLTextFieldAccessible::
}
NS_IMPL_ISUPPORTS_INHERITED0(HTMLTextFieldAccessible,
HyperTextAccessible)
role
HTMLTextFieldAccessible::NativeRole()
{
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::password, eIgnoreCase)) {
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::password, eIgnoreCase)) {
return roles::PASSWORD_TEXT;
}
return roles::ENTRY;
}
already_AddRefed<nsIPersistentProperties>
HTMLTextFieldAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
HyperTextAccessibleWrap::NativeAttributes();
// Expose type for text input elements as it gives some useful context,
// especially for mobile.
nsAutoString type;
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type)) {
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type)) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::textInputType, type);
if (!ARIARoleMap() && type.EqualsLiteral("search")) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::xmlroles,
NS_LITERAL_STRING("searchbox"));
}
}
return attributes.forget();
@@ -329,17 +330,17 @@ HTMLTextFieldAccessible::NativeName(nsSt
nsIContent* widgetElm = XULWidgetElm();
if (widgetElm)
XULElmName(mDoc, widgetElm, aName);
if (!aName.IsEmpty())
return eNameOK;
// text inputs and textareas might have useful placeholder text
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, aName);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, aName);
return eNameOK;
}
void
HTMLTextFieldAccessible::Value(nsString& aValue)
{
aValue.Truncate();
if (NativeState() & states::PROTECTED) // Don't return password text!
@@ -377,22 +378,22 @@ HTMLTextFieldAccessible::NativeState()
{
uint64_t state = HyperTextAccessibleWrap::NativeState();
// Text fields are always editable, even if they are also read only or
// disabled.
state |= states::EDITABLE;
// can be focusable, focused, protected. readonly, unavailable, selected
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::password, eIgnoreCase)) {
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::password, eIgnoreCase)) {
state |= states::PROTECTED;
}
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::readonly)) {
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::readonly)) {
state |= states::READONLY;
}
// Is it an <input> or a <textarea> ?
HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
state |= input && input->IsSingleLineTextControl() ?
states::SINGLE_LINE : states::MULTI_LINE;
@@ -403,38 +404,38 @@ HTMLTextFieldAccessible::NativeState()
// Expose autocomplete states if this input is part of autocomplete widget.
Accessible* widget = ContainerWidget();
if (widget && widget-IsAutoComplete()) {
state |= states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION;
return state;
}
// Expose autocomplete state if it has associated autocomplete list.
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::list))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::list))
return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP;
// Ordinal XUL textboxes don't support autocomplete.
if (!XULWidgetElm() && Preferences::GetBool("browser.formfill.enable")) {
// Check to see if autocompletion is allowed on this input. We don't expose
// it for password fields even though the entire password can be remembered
// for a page if the user asks it to be. However, the kind of autocomplete
// we're talking here is based on what the user types, where a popup of
// possible choices comes up.
nsAutoString autocomplete;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::autocomplete,
- autocomplete);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::autocomplete,
+ autocomplete);
if (!autocomplete.LowerCaseEqualsLiteral("off")) {
- nsIContent* formContent = input->GetFormElement();
- if (formContent) {
- formContent->GetAttr(kNameSpaceID_None,
+ Element* formElement = input->GetFormElement();
+ if (formElement) {
+ formElement->GetAttr(kNameSpaceID_None,
nsGkAtoms::autocomplete, autocomplete);
}
- if (!formContent || !autocomplete.LowerCaseEqualsLiteral("off"))
+ if (!formElement || !autocomplete.LowerCaseEqualsLiteral("off"))
state |= states::SUPPORTS_AUTOCOMPLETION;
}
}
return state;
}
uint8_t
--- a/accessible/html/HTMLImageMapAccessible.cpp
+++ b/accessible/html/HTMLImageMapAccessible.cpp
@@ -150,29 +150,30 @@ HTMLAreaAccessible::
ENameValueFlag
HTMLAreaAccessible::NativeName(nsString& aName)
{
ENameValueFlag nameFlag = Accessible::NativeName(aName);
if (!aName.IsEmpty())
return nameFlag;
- if (!mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName))
+ if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName))
Value(aName);
return eNameOK;
}
void
HTMLAreaAccessible::Description(nsString& aDescription)
{
aDescription.Truncate();
// Still to do - follow IE's standard here
- RefPtr<HTMLAreaElement> area = HTMLAreaElement::FromContentOrNull(mContent);
+ RefPtr<dom::HTMLAreaElement> area =
+ dom::HTMLAreaElement::FromContentOrNull(mContent);
if (area)
area->GetShape(aDescription);
}
////////////////////////////////////////////////////////////////////////////////
// HTMLAreaAccessible: Accessible public
Accessible*
@@ -216,12 +217,11 @@ HTMLAreaAccessible::RelativeBounds(nsIFr
nsRect bounds;
nsresult rv = map->GetBoundsForAreaContent(mContent, bounds);
if (NS_FAILED(rv))
return nsRect();
// XXX Areas are screwy; they return their rects as a pair of points, one pair
// stored into the width and height.
*aBoundingFrame = frame;
- bounds.width -= bounds.x;
- bounds.height -= bounds.y;
+ bounds.SizeTo(bounds.Width() - bounds.X(), bounds.Height() - bounds.Y());
return bounds;
}
--- a/accessible/html/HTMLLinkAccessible.cpp
+++ b/accessible/html/HTMLLinkAccessible.cpp
@@ -63,17 +63,17 @@ HTMLLinkAccessible::NativeLinkState() co
uint64_t
HTMLLinkAccessible::NativeInteractiveState() const
{
uint64_t state = HyperTextAccessibleWrap::NativeInteractiveState();
// This is how we indicate it is a named anchor. In other words, this anchor
// can be selected as a location :) There is no other better state to use to
// indicate this.
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::name))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::name))
state |= states::SELECTABLE;
return state;
}
void
HTMLLinkAccessible::Value(nsString& aValue)
{
--- a/accessible/html/HTMLListAccessible.cpp
+++ b/accessible/html/HTMLListAccessible.cpp
@@ -82,18 +82,18 @@ nsIntRect
HTMLLIAccessible::Bounds() const
{
nsIntRect rect = AccessibleWrap::Bounds();
if (rect.IsEmpty() || !mBullet || mBullet->IsInside())
return rect;
nsIntRect bulletRect = mBullet->Bounds();
- rect.width += rect.x - bulletRect.x;
- rect.x = bulletRect.x; // Move x coordinate of list item over to cover bullet as well
+ // Move x coordinate of list item over to cover bullet as well
+ rect.SetLeftEdge(bulletRect.X());
return rect;
}
bool
HTMLLIAccessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
{
// Adjust index if there's a bullet.
if (mBullet && aIndex == 0 && aChild != mBullet) {
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -37,17 +37,17 @@ HTMLSelectListAccessible::
////////////////////////////////////////////////////////////////////////////////
// HTMLSelectListAccessible: Accessible public
uint64_t
HTMLSelectListAccessible::NativeState()
{
uint64_t state = AccessibleWrap::NativeState();
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
state |= states::MULTISELECTABLE | states::EXTSELECTABLE;
return state;
}
role
HTMLSelectListAccessible::NativeRole()
{
@@ -55,24 +55,24 @@ HTMLSelectListAccessible::NativeRole()
}
////////////////////////////////////////////////////////////////////////////////
// HTMLSelectListAccessible: SelectAccessible
bool
HTMLSelectListAccessible::SelectAll()
{
- return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple) ?
+ return mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple) ?
AccessibleWrap::SelectAll() : false;
}
bool
HTMLSelectListAccessible::UnselectAll()
{
- return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple) ?
+ return mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple) ?
AccessibleWrap::UnselectAll() : false;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLSelectListAccessible: Widgets
bool
HTMLSelectListAccessible::IsWidget() const
@@ -147,17 +147,17 @@ HTMLSelectOptionAccessible::NativeRole()
return roles::OPTION;
}
ENameValueFlag
HTMLSelectOptionAccessible::NativeName(nsString& aName)
{
// CASE #1 -- great majority of the cases
// find the label attribute - this is what the W3C says we should use
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
if (!aName.IsEmpty())
return eNameOK;
// CASE #2 -- no label parameter, get the first child,
// use it if it is a text node
nsIContent* text = mContent->GetFirstChild();
if (text && text->IsNodeOfType(nsINode::eTEXT)) {
nsTextEquivUtils::AppendTextEquivFromTextContent(text, &aName);
@@ -208,18 +208,18 @@ HTMLSelectOptionAccessible::NativeState(
// XXX list frames are weird, don't rely on Accessible's general
// visibility implementation unless they get reimplemented in layout
state &= ~states::OFFSCREEN;
// <select> is not collapsed: compare bounds to calculate OFFSCREEN
Accessible* listAcc = Parent();
if (listAcc) {
nsIntRect optionRect = Bounds();
nsIntRect listRect = listAcc->Bounds();
- if (optionRect.y < listRect.y ||
- optionRect.y + optionRect.height > listRect.y + listRect.height) {
+ if (optionRect.Y() < listRect.Y() ||
+ optionRect.YMost() > listRect.YMost()) {
state |= states::OFFSCREEN;
}
}
}
return state;
}
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -117,24 +117,24 @@ HTMLTableCellAccessible::NativeAttribute
nsIContent* firstChildNode = abbr->GetContent()->GetFirstChild();
if (firstChildNode) {
nsTextEquivUtils::
AppendTextEquivFromTextContent(firstChildNode, &abbrText);
}
}
}
if (abbrText.IsEmpty())
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::abbr, abbrText);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::abbr, abbrText);
if (!abbrText.IsEmpty())
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::abbr, abbrText);
// axis attribute
nsAutoString axisText;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::axis, axisText);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::axis, axisText);
if (!axisText.IsEmpty())
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::axis, axisText);
#ifdef DEBUG
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("cppclass"),
NS_LITERAL_STRING("HTMLTableCellAccessible"),
unused);
@@ -307,22 +307,22 @@ HTMLTableHeaderCellAccessible::
////////////////////////////////////////////////////////////////////////////////
// HTMLTableHeaderCellAccessible: Accessible implementation
role
HTMLTableHeaderCellAccessible::NativeRole()
{
// Check value of @scope attribute.
- static nsIContent::AttrValuesArray scopeValues[] =
+ static Element::AttrValuesArray scopeValues[] =
{ &nsGkAtoms::col, &nsGkAtoms::colgroup,
&nsGkAtoms::row, &nsGkAtoms::rowgroup, nullptr };
int32_t valueIdx =
- mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
- scopeValues, eCaseMatters);
+ mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
+ scopeValues, eCaseMatters);
switch (valueIdx) {
case 0:
case 1:
return roles::COLUMNHEADER;
case 2:
case 3:
return roles::ROWHEADER;
@@ -432,17 +432,17 @@ HTMLTableAccessible::NativeName(nsString
if (captionContent) {
nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent, &aName);
if (!aName.IsEmpty())
return eNameOK;
}
}
// If no caption then use summary as a name.
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::summary, aName);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::summary, aName);
return eNameOK;
}
already_AddRefed<nsIPersistentProperties>
HTMLTableAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
AccessibleWrap::NativeAttributes();
@@ -858,18 +858,18 @@ HTMLTableAccessible::Description(nsStrin
if (caption) {
nsIContent* captionContent = caption->GetContent();
if (captionContent) {
nsAutoString captionText;
nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent,
&captionText);
if (!captionText.IsEmpty()) { // summary isn't used as a name.
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::summary,
- aDescription);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::summary,
+ aDescription);
}
}
}
#ifdef SHOW_LAYOUT_HEURISTIC
if (aDescription.IsEmpty()) {
bool isProbablyForLayout = IsProbablyLayoutTable();
aDescription = mLayoutHeuristic;
@@ -941,35 +941,35 @@ HTMLTableAccessible::IsProbablyLayoutTab
}
}
// Check to see if an ARIA role overrides the role from native markup,
// but for which we still expose table semantics (treegrid, for example).
if (Role() != roles::TABLE)
RETURN_LAYOUT_ANSWER(false, "Has role attribute");
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::role)) {
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::role)) {
// Role attribute is present, but overridden roles have already been dealt with.
// Only landmarks and other roles that don't override the role from native
// markup are left to deal with here.
RETURN_LAYOUT_ANSWER(false, "Has role attribute, weak role, and role is table");
}
NS_ASSERTION(mContent->IsHTMLElement(nsGkAtoms::table),
"table should not be built by CSS display:table style");
// Check if datatable attribute has "0" value.
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::datatable,
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::datatable,
NS_LITERAL_STRING("0"), eCaseMatters)) {
RETURN_LAYOUT_ANSWER(true, "Has datatable = 0 attribute, it's for layout");
}
// Check for legitimate data table attributes.
nsAutoString summary;
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::summary, summary) &&
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::summary, summary) &&
!summary.IsEmpty())
RETURN_LAYOUT_ANSWER(false, "Has summary -- legitimate table structures");
// Check for legitimate data table elements.
Accessible* caption = FirstChild();
if (caption && caption->Role() == roles::CAPTION && caption->HasChildren())
RETURN_LAYOUT_ANSWER(false, "Not empty caption -- legitimate table structures");
@@ -994,19 +994,19 @@ HTMLTableAccessible::IsProbablyLayoutTab
cellElm = cellElm->GetNextSibling()) {
if (cellElm->IsHTMLElement()) {
if (cellElm->NodeInfo()->Equals(nsGkAtoms::th)) {
RETURN_LAYOUT_ANSWER(false,
"Has th -- legitimate table structures");
}
- if (cellElm->HasAttr(kNameSpaceID_None, nsGkAtoms::headers) ||
- cellElm->HasAttr(kNameSpaceID_None, nsGkAtoms::scope) ||
- cellElm->HasAttr(kNameSpaceID_None, nsGkAtoms::abbr)) {
+ if (cellElm->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::headers) ||
+ cellElm->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::scope) ||
+ cellElm->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::abbr)) {
RETURN_LAYOUT_ANSWER(false,
"Has headers, scope, or abbr attribute -- legitimate table structures");
}
Accessible* cell = mDoc->GetAccessible(cellElm);
if (cell && cell->ChildCount() == 1 &&
cell->FirstChild()->IsAbbreviation()) {
RETURN_LAYOUT_ANSWER(false,
--- a/accessible/interfaces/nsIAccessible.idl
+++ b/accessible/interfaces/nsIAccessible.idl
@@ -2,17 +2,16 @@
/* 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/. */
#include "nsISupports.idl"
#include "nsIArray.idl"
interface nsIPersistentProperties;
-interface nsIDOMCSSPrimitiveValue;
interface nsIDOMNode;
interface nsIAccessibleDocument;
interface nsIAccessibleRelation;
%{C++
namespace mozilla {
namespace a11y {
class Accessible;
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -618,18 +618,18 @@ DocAccessibleParent::MaybeInitWindowEmul
RootAccessible* rootDocument = outerDoc->RootAccessible();
MOZ_ASSERT(rootDocument);
bool isActive = true;
nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
if (Compatibility::IsDolphin()) {
rect = Bounds();
nsIntRect rootRect = rootDocument->Bounds();
- rect.x = rootRect.x - rect.x;
- rect.y -= rootRect.y;
+ rect.MoveToX(rootRect.X() - rect.X());
+ rect.MoveToY(rect.Y() - rootRect.Y());
auto tab = static_cast<dom::TabParent*>(Manager());
tab->GetDocShellIsActive(&isActive);
}
nsWinUtils::NativeWindowCreateProc onCreate([this](HWND aHwnd) -> void {
IDispatchHolder hWndAccHolder;
@@ -647,18 +647,18 @@ DocAccessibleParent::MaybeInitWindowEmul
Unused << SendEmulatedWindow(reinterpret_cast<uintptr_t>(mEmulatedWindowHandle),
hWndAccHolder);
});
HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow());
DebugOnly<HWND> hWnd = nsWinUtils::CreateNativeWindow(kClassNameTabContent,
parentWnd,
- rect.x, rect.y,
- rect.width, rect.height,
+ rect.X(), rect.Y(),
+ rect.Width(), rect.Height(),
isActive, &onCreate);
MOZ_ASSERT(hWnd);
}
/**
* @param aCOMProxy COM Proxy to the document in the content process.
*/
void
--- a/accessible/ipc/win/ProxyAccessible.cpp
+++ b/accessible/ipc/win/ProxyAccessible.cpp
@@ -226,20 +226,17 @@ ProxyAccessible::Bounds()
long left;
long top;
long width;
long height;
HRESULT hr = acc->accLocation(&left, &top, &width, &height, kChildIdSelf);
if (FAILED(hr)) {
return rect;
}
- rect.x = left;
- rect.y = top;
- rect.width = width;
- rect.height = height;
+ rect.SetRect(left, top, width, height);
return rect;
}
void
ProxyAccessible::Language(nsString& aLocale)
{
aLocale.Truncate();
--- a/accessible/ipc/win/handler/AccessibleHandler.cpp
+++ b/accessible/ipc/win/handler/AccessibleHandler.cpp
@@ -1216,18 +1216,22 @@ static const GUID kUnsupportedServices[]
// Unknown, queried by Windows
{0x33f139ee, 0xe509, 0x47f7, {0xbf, 0x39, 0x83, 0x76, 0x44, 0xf7, 0x45, 0x76}},
// Unknown, queried by Windows
{0xFDA075CF, 0x7C8B, 0x498C, { 0xB5, 0x14, 0xA9, 0xCB, 0x52, 0x1B, 0xBF, 0xB4 }},
// Unknown, queried by Windows
{0x8EDAA462, 0x21F4, 0x4C87, { 0xA0, 0x12, 0xB3, 0xCD, 0xA3, 0xAB, 0x01, 0xFC }},
// Unknown, queried by Windows
{0xacd46652, 0x829d, 0x41cb, { 0xa5, 0xfc, 0x17, 0xac, 0xf4, 0x36, 0x61, 0xac }},
- // Unknown, queried by Windows
- {0xb96fdb85, 0x7204, 0x4724, { 0x84, 0x2b, 0xc7, 0x05, 0x9d, 0xed, 0xb9, 0xd0 }}
+ // SID_IsUIAutomationObject (undocumented), queried by Windows
+ {0xb96fdb85, 0x7204, 0x4724, { 0x84, 0x2b, 0xc7, 0x05, 0x9d, 0xed, 0xb9, 0xd0 }},
+ // IIS_IsOleaccProxy (undocumented), queried by Windows
+ {0x902697FA, 0x80E4, 0x4560, {0x80, 0x2A, 0xA1, 0x3F, 0x22, 0xA6, 0x47, 0x09}},
+ // IID_IHTMLElement, queried by JAWS
+ {0x3050F1FF, 0x98B5, 0x11CF, {0xBB, 0x82, 0x00, 0xAA, 0x00, 0xBD, 0xCE, 0x0B}}
};
/*** IServiceProvider ***/
HRESULT
AccessibleHandler::QueryService(REFGUID aServiceId, REFIID aIid,
void** aOutInterface)
{
@@ -1237,16 +1241,23 @@ AccessibleHandler::QueryService(REFGUID
of our own object to implement this just like a QI. */
if (aIid == IID_IAccessible2_3 || aIid == IID_IAccessible2_2 ||
aIid == IID_IAccessible2) {
RefPtr<NEWEST_IA2_INTERFACE> ia2(this);
ia2.forget(aOutInterface);
return S_OK;
}
+ // JAWS uses QueryService for these, but QI will work just fine and we can
+ // thus avoid a cross-process call. More importantly, if QS is used, the
+ // handler won't get used for that object, so our caching won't be used.
+ if (aIid == IID_IAccessibleAction || aIid == IID_IAccessibleText) {
+ return InternalQueryInterface(aIid, aOutInterface);
+ }
+
for (uint32_t i = 0; i < ArrayLength(kUnsupportedServices); ++i) {
if (aServiceId == kUnsupportedServices[i]) {
return E_NOINTERFACE;
}
}
if (!mServProvPassThru) {
RefPtr<IUnknown> proxy(GetProxy());
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -293,17 +293,17 @@ this.AccessFu = { // jshint ignore:line
_handleMessageManager: function _handleMessageManager(aMessageManager) {
if (this._enabled) {
this._addMessageListeners(aMessageManager);
}
this._loadFrameScript(aMessageManager);
},
- onEvent: function(event, data, callback) {
+ onEvent(event, data, callback) {
switch (event) {
case "Accessibility:Settings":
this._systemPref = data.enabled;
this._enableOrDisable();
break;
case "Accessibility:NextObject":
case "Accessibility:PreviousObject": {
let rule = "Simple";
@@ -420,18 +420,17 @@ this.AccessFu = { // jshint ignore:line
/**
* Adjusts the given bounds relative to the given browser.
* @param {Rect} aJsonBounds the bounds to adjust
* @param {browser} aBrowser the browser we want the bounds relative to
* @param {bool} aToCSSPixels whether to convert to CSS pixels (as opposed to
* device pixels)
*/
- adjustContentBounds:
- function(aJsonBounds, aBrowser, aToCSSPixels) {
+ adjustContentBounds(aJsonBounds, aBrowser, aToCSSPixels) {
let bounds = new Rect(aJsonBounds.left, aJsonBounds.top,
aJsonBounds.right - aJsonBounds.left,
aJsonBounds.bottom - aJsonBounds.top);
let win = Utils.win;
let dpr = win.devicePixelRatio;
let offset = { left: -win.mozInnerScreenX, top: -win.mozInnerScreenY };
// Add the offset; the offset is in CSS pixels, so multiply the
@@ -874,17 +873,17 @@ var Input = {
},
activateCurrent: function activateCurrent(aData, aActivateIfKey = false) {
let mm = Utils.getMessageManager(Utils.CurrentBrowser);
let offset = aData && typeof aData.keyIndex === "number" ?
aData.keyIndex - Output.brailleState.startOffset : -1;
mm.sendAsyncMessage("AccessFu:Activate",
- {offset: offset, activateIfKey: aActivateIfKey});
+ {offset, activateIfKey: aActivateIfKey});
},
sendContextMenuMessage: function sendContextMenuMessage() {
let mm = Utils.getMessageManager(Utils.CurrentBrowser);
mm.sendAsyncMessage("AccessFu:ContextMenu", {});
},
setEditState: function setEditState(aEditState) {
--- a/accessible/jsat/EventManager.jsm
+++ b/accessible/jsat/EventManager.jsm
@@ -234,17 +234,17 @@ this.EventManager.prototype = {
Ci.nsIAccessibleObjectAttributeChangedEvent);
if (evt.changedAttribute !== "aria-hidden") {
// Only handle aria-hidden attribute change.
break;
}
let hidden = Utils.isHidden(aEvent.accessible);
this[hidden ? "_handleHide" : "_handleShow"](evt);
if (this.inTest) {
- this.sendMsgFunc("AccessFu:AriaHidden", { hidden: hidden });
+ this.sendMsgFunc("AccessFu:AriaHidden", { hidden });
}
break;
}
case Events.SHOW:
{
this._handleShow(aEvent);
break;
}
--- a/accessible/jsat/Gestures.jsm
+++ b/accessible/jsat/Gestures.jsm
@@ -300,17 +300,17 @@ function compileDetail(aType, aPoints, k
maxDeltaY = deltaY;
}
// Since the gesture is resolving, reset the points' distance information
// since they are passed to the next potential gesture.
point.reset();
}
return {
type: aType,
- touches: touches,
+ touches,
deltaX: maxDeltaX,
deltaY: maxDeltaY
};
}
/**
* A general gesture object.
* @param {Number} aTimeStamp An original pointer event's timeStamp that started
--- a/accessible/jsat/Presentation.jsm
+++ b/accessible/jsat/Presentation.jsm
@@ -164,17 +164,17 @@ VisualPresenter.prototype.viewportChange
if (Utils.isAliveAndVisible(currentAcc)) {
let bounds = (start === -1 && end === -1) ? Utils.getBounds(currentAcc) :
Utils.getTextBounds(currentAcc, start, end);
return {
type: this.type,
details: {
eventType: "viewport-change",
- bounds: bounds,
+ bounds,
padding: this.BORDER_PADDING
}
};
}
return null;
};
@@ -193,17 +193,17 @@ VisualPresenter.prototype.pivotChanged =
aContext.bounds : Utils.getTextBounds(aContext.accessibleForBounds,
aContext.startOffset,
aContext.endOffset);
return {
type: this.type,
details: {
eventType: "vc-change",
- bounds: bounds,
+ bounds,
padding: this.BORDER_PADDING
}
};
} catch (e) {
Logger.logException(e, "Failed to get bounds");
return null;
}
};
@@ -292,17 +292,17 @@ AndroidPresenter.prototype.pivotChanged
androidEvents.push({eventType: (isExploreByTouch) ?
this.ANDROID_VIEW_HOVER_ENTER : focusEventType,
text: Utils.localize(UtteranceGenerator.genForContext(
aContext)),
bounds: aContext.bounds,
clickable: aContext.accessible.actionCount > 0,
checkable: state.contains(States.CHECKABLE),
checked: state.contains(States.CHECKED),
- brailleOutput: brailleOutput});
+ brailleOutput});
}
return {
type: this.type,
details: androidEvents
};
};
@@ -318,17 +318,17 @@ AndroidPresenter.prototype.actionInvoked
text = Utils.localize(UtteranceGenerator.genForAction(aObject,
aActionName));
}
return {
type: this.type,
details: [{
eventType: this.ANDROID_VIEW_CLICKED,
- text: text,
+ text,
checked: state.contains(States.CHECKED)
}]
};
};
AndroidPresenter.prototype.tabSelected =
function AndroidPresenter_tabSelected(aDocContext, aVCContext) {
// Send a pivot change message with the full context utterance for this doc.
@@ -377,17 +377,17 @@ AndroidPresenter.prototype.textSelection
aText, aStart, aEnd, aOldStart, aOldEnd, aIsFromUserInput).details;
androidEvents.push({
eventType: this.ANDROID_VIEW_TEXT_SELECTION_CHANGED,
text: [aText],
fromIndex: aStart,
toIndex: aEnd,
itemCount: aText.length,
- brailleOutput: brailleOutput
+ brailleOutput
});
}
if (Utils.AndroidSdkVersion >= 16 && aIsFromUserInput) {
let [from, to] = aOldStart < aStart ?
[aOldStart, aStart] : [aStart, aOldStart];
androidEvents.push({
eventType: this.ANDROID_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
--- a/accessible/tests/browser/tree/browser_aria_owns.js
+++ b/accessible/tests/browser/tree/browser_aria_owns.js
@@ -213,8 +213,41 @@ addAccessibleTask(`<div id="a"></div><di
document.documentElement.getBoundingClientRect();
document.body.setAttribute("aria-owns", "b a");
document.documentElement.remove();
});
testChildrenIds(accDoc, []);
}
);
+
+// Don't allow ordinal child to be placed after aria-owned child (bug 1405796)
+addAccessibleTask(`<div id="container"><div id="a">Hello</div></div>
+ <div><div id="c">There</div><div id="d">There</div></div>`,
+ async function(browser, accDoc) {
+ let containerAcc = findAccessibleChildByID(accDoc, "container");
+
+ testChildrenIds(containerAcc, ["a"]);
+
+ await contentSpawnMutation(browser, MOVE, function() {
+ document.getElementById("container").setAttribute("aria-owns", "c");
+ });
+
+ testChildrenIds(containerAcc, ["a", "c"]);
+
+ await contentSpawnMutation(browser, MOVE, function() {
+ let span = document.createElement("span");
+ document.getElementById("container").appendChild(span);
+
+ let b = document.createElement("div");
+ b.id = "b";
+ document.getElementById("container").appendChild(b);
+ });
+
+ testChildrenIds(containerAcc, ["a", "b", "c"]);
+
+ await contentSpawnMutation(browser, MOVE, function() {
+ document.getElementById("container").setAttribute("aria-owns", "c d");
+ });
+
+ testChildrenIds(containerAcc, ["a", "b", "c", "d"]);
+ }
+);
--- a/accessible/tests/mochitest/.eslintrc.js
+++ b/accessible/tests/mochitest/.eslintrc.js
@@ -6,19 +6,12 @@ module.exports = {
],
"rules": {
"mozilla/no-cpows-in-tests": "error",
"mozilla/reject-importGlobalProperties": "error",
// XXX These are rules that are enabled in the recommended configuration, but
// disabled here due to failures when initially implemented. They should be
// removed (and hence enabled) at some stage.
- "comma-spacing": "off",
- "no-cond-assign": "off",
- "no-lonely-if": "off",
"no-nested-ternary": "off",
- "no-new-object": "off",
- "no-redeclare": "off",
- "no-shadow": "off",
"no-undef": "off",
- "space-unary-ops": "off",
}
};
--- a/accessible/tests/mochitest/actions/test_link.html
+++ b/accessible/tests/mochitest/actions/test_link.html
@@ -19,17 +19,17 @@
<script type="application/javascript">
function getAnchorTargetDocumentAcc() {
var thisTabDocAcc = getTabDocAccessible();
var thisDocTabPanelAcc = thisTabDocAcc.parent.parent;
var tabPanelsAcc = thisDocTabPanelAcc.parent;
var newDocTabPanelAcc = tabPanelsAcc.firstChild;
var nextAcc = newDocTabPanelAcc;
- while (nextAcc = nextAcc.nextSibling) {
+ while ((nextAcc = nextAcc.nextSibling)) {
// Find the last accessible for a browser with about:mozilla loaded.
if (nextAcc.firstChild.DOMNode.currentURI.spec == "about:mozilla") {
newDocTabPanelAcc = nextAcc;
}
}
return newDocTabPanelAcc.firstChild.firstChild;
}
--- a/accessible/tests/mochitest/aom/test_general.html
+++ b/accessible/tests/mochitest/aom/test_general.html
@@ -67,17 +67,17 @@
states = [
"readonly", "busy", "focusable", "opaque", "stale", "enabled", "sensitive"
];
break;
default:
ok(false, "Unexpected amount of states");
}
if (states) {
- for (var i = 0; i < states.length; i++) {
+ for (let i = 0; i < states.length; i++) {
is(anode.states[i], states[i], `${states[i]} state is expected at ${i}th index`);
}
}
ok(anode.is("document", "focusable"),
"correct role and state on an accessible node");
is(anode.get("explicit-name"), "true",
@@ -91,17 +91,17 @@
attrs = [
"margin-left", "text-align", "text-indent", "margin-right",
"tag", "margin-top", "margin-bottom", "display",
"explicit-name"
];
}
is(anode.attributes.length, attrs.length, "correct number of attributes");
- for (var i = 0; i < attrs.length; i++) {
+ for (let i = 0; i < attrs.length; i++) {
ok(attrs.indexOf(anode.attributes[i]) >= 0,
`${anode.attributes[i]} attribute is expected and found`);
}
finish();
}
</script>
</head>
--- a/accessible/tests/mochitest/attributes.js
+++ b/accessible/tests/mochitest/attributes.js
@@ -75,28 +75,28 @@ function testGroupAttrs(aAccOrElmOrID, a
acc.groupPosition(levelObj, setSizeObj, posInSetObj);
if (aPosInSet && aSetSize) {
is(posInSetObj.value, aPosInSet,
"Wrong group position (posinset) for " + prettyName(aAccOrElmOrID));
is(setSizeObj.value, aSetSize,
"Wrong size of the group (setsize) for " + prettyName(aAccOrElmOrID));
- var attrs = {
+ let attrs = {
"posinset": String(aPosInSet),
"setsize": String(aSetSize)
};
testAttrs(aAccOrElmOrID, attrs, true);
}
if (aLevel) {
is(levelObj.value, aLevel,
"Wrong group level for " + prettyName(aAccOrElmOrID));
- var attrs = { "level": String(aLevel) };
+ let attrs = { "level": String(aLevel) };
testAttrs(aAccOrElmOrID, attrs, true);
}
}
// //////////////////////////////////////////////////////////////////////////////
// Text attributes.
/**
@@ -138,20 +138,20 @@ function testTextAttrs(aID, aOffset, aAt
is(startOffset.value, aStartOffset, "Wrong start offset" + errorMsg);
is(endOffset.value, aEndOffset, "Wrong end offset" + errorMsg);
compareAttrs(errorMsg, attrs, aAttrs, aSkipUnexpectedAttrs);
// include attributes exposed on hyper text accessible
var expectedAttrs = {};
- for (var name in aAttrs)
+ for (let name in aAttrs)
expectedAttrs[name] = aAttrs[name];
- for (var name in aDefAttrs) {
+ for (let name in aDefAttrs) {
if (!(name in expectedAttrs))
expectedAttrs[name] = aDefAttrs[name];
}
attrs = getTextAttributes(aID, accessible, true, aOffset,
startOffset, endOffset);
if (!attrs)
@@ -194,17 +194,17 @@ function testDefaultTextAttrs(aID, aDefA
* Test text attributes for wrong offset.
*/
function testTextAttrsWrongOffset(aID, aOffset) {
var res = false;
try {
var s = {}, e = {};
var acc = getAccessible(ID, [nsIAccessibleText]);
acc.getTextAttributes(false, 157, s, e);
- } catch (e) {
+ } catch (ex) {
res = true;
}
ok(res,
"text attributes are calculated successfully at wrong offset " + aOffset + " for " + prettyName(aID));
}
const kNormalFontWeight =
@@ -316,17 +316,17 @@ function testAttrsInternal(aAccOrElmOrID
compareAttrs(errorMsg, attrs, aAttrs, aSkipUnexpectedAttrs, aAbsentAttrs);
}
function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs,
aAbsentAttrs) {
// Check if all obtained attributes are expected and have expected value.
var enumerate = aAttrs.enumerate();
while (enumerate.hasMoreElements()) {
- var prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
+ let prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
if (!(prop.key in aExpectedAttrs)) {
if (!aSkipUnexpectedAttrs)
ok(false, "Unexpected attribute '" + prop.key + "' having '" +
prop.value + "'" + aErrorMsg);
} else {
var msg = "Attribute '" + prop.key + "' has wrong value" + aErrorMsg;
var expectedValue = aExpectedAttrs[prop.key];
@@ -334,35 +334,35 @@ function compareAttrs(aErrorMsg, aAttrs,
if (typeof expectedValue == "function")
ok(expectedValue(prop.value), msg);
else
is(prop.value, expectedValue, msg);
}
}
// Check if all expected attributes are presented.
- for (var name in aExpectedAttrs) {
+ for (let name in aExpectedAttrs) {
var value = "";
try {
value = aAttrs.getStringProperty(name);
} catch (e) { }
if (!value)
ok(false,
"There is no expected attribute '" + name + "' " + aErrorMsg);
}
// Check if all unexpected attributes are absent.
if (aAbsentAttrs) {
for (var name in aAbsentAttrs) {
var wasFound = false;
- var enumerate = aAttrs.enumerate();
+ enumerate = aAttrs.enumerate();
while (enumerate.hasMoreElements()) {
- var prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
+ let prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
if (prop.key == name)
wasFound = true;
}
}
ok(!wasFound,
"There is an unexpected attribute '" + name + "' " + aErrorMsg);
}
--- a/accessible/tests/mochitest/attributes/a11y.ini
+++ b/accessible/tests/mochitest/attributes/a11y.ini
@@ -1,13 +1,14 @@
[DEFAULT]
support-files =
!/accessible/tests/mochitest/*.js
[test_dpub_aria_xml-roles.html]
+[test_graphics_aria_xml-roles.html]
[test_obj.html]
[test_obj_css.html]
[test_obj_css.xul]
[test_obj_group.html]
[test_obj_group.xul]
[test_obj_group_tree.xul]
[test_tag.html]
[test_xml-roles.html]
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/attributes/test_graphics_aria_xml-roles.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>XML roles tests</title>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+ <script type="application/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+ <script type="application/javascript"
+ src="../common.js"></script>
+ <script type="application/javascript"
+ src="../role.js"></script>
+ <script type="application/javascript"
+ src="../attributes.js"></script>
+
+ <script type="application/javascript">
+
+ function doTest() {
+ // Graphics ARIA roles should be exposed via the xml-roles object attribute.
+ let graphics_attrs = [
+ "graphics-document",
+ "graphics-object",
+ "graphics-symbol"
+ ];
+ for (let attr of graphics_attrs) {
+ testAttrs(attr, {"xml-roles": attr}, true);
+ }
+ SimpleTest.finish();
+ }
+ SimpleTest.waitForExplicitFinish();
+ addA11yLoadEvent(doTest);
+ </script>
+</head>
+<body>
+ <a target="_blank"
+ href="https://bugzilla.mozilla.org/show_bug.cgi?id=1432513"
+ title="implement ARIA Graphics roles">
+ Bug 1432513
+ </a>
+ <p id="display"></p>
+ <div id="content" style="display: none"></div>
+ <pre id="test"></pre>
+ <div id="graphics-document" role="graphics-document">document</div>
+ <div id="graphics-object" role="graphics-object">object</div>
+ <div id="graphics-symbol" role="graphics-symbol">symbol</div>
+</body>
+</html>
--- a/accessible/tests/mochitest/autocomplete.js
+++ b/accessible/tests/mochitest/autocomplete.js
@@ -71,17 +71,17 @@ function ResultsHeap(aValues, aComments)
ResultsHeap.prototype =
{
constructor: ResultsHeap,
/**
* Return AutoCompleteResult for the given search string.
*/
- getAutoCompleteResultFor: function(aSearchString) {
+ getAutoCompleteResultFor(aSearchString) {
var values = [], comments = [];
for (var idx = 0; idx < this.values.length; idx++) {
if (this.values[idx].indexOf(aSearchString) != -1) {
values.push(this.values[idx]);
comments.push(this.comments[idx]);
}
}
return new AutoCompleteResult(values, comments);
@@ -100,36 +100,35 @@ function AutoCompleteSearch(aName, aAllR
this.allResults = aAllResults;
}
AutoCompleteSearch.prototype =
{
constructor: AutoCompleteSearch,
// nsIAutoCompleteSearch implementation
- startSearch: function(aSearchString, aSearchParam, aPreviousResult,
- aListener) {
+ startSearch(aSearchString, aSearchParam, aPreviousResult, aListener) {
var result = this.allResults.getAutoCompleteResultFor(aSearchString);
aListener.onSearchResult(this, result);
},
- stopSearch: function() {},
+ stopSearch() {},
// nsISupports implementation
- QueryInterface: function(iid) {
+ QueryInterface(iid) {
if (iid.equals(nsISupports) ||
iid.equals(nsIFactory) ||
iid.equals(nsIAutoCompleteSearch))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
// nsIFactory implementation
- createInstance: function(outer, iid) {
+ createInstance(outer, iid) {
return this.QueryInterface(iid);
},
// Search name. Used by AutoCompleteController.
name: null,
// Results heap.
allResults: null
@@ -157,44 +156,44 @@ AutoCompleteResult.prototype =
searchResult: null,
defaultIndex: 0,
get matchCount() {
return this.values.length;
},
- getValueAt: function(aIndex) {
+ getValueAt(aIndex) {
return this.values[aIndex];
},
- getLabelAt: function(aIndex) {
+ getLabelAt(aIndex) {
return this.getValueAt(aIndex);
},
- getCommentAt: function(aIndex) {
+ getCommentAt(aIndex) {
return this.comments[aIndex];
},
- getStyleAt: function(aIndex) {
+ getStyleAt(aIndex) {
return null;
},
- getImageAt: function(aIndex) {
+ getImageAt(aIndex) {
return "";
},
- getFinalCompleteValueAt: function(aIndex) {
+ getFinalCompleteValueAt(aIndex) {
return this.getValueAt(aIndex);
},
- removeValueAt: function(aRowIndex, aRemoveFromDb) {},
+ removeValueAt(aRowIndex, aRemoveFromDb) {},
// nsISupports implementation
- QueryInterface: function(iid) {
+ QueryInterface(iid) {
if (iid.equals(nsISupports) ||
iid.equals(nsIAutoCompleteResult))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
// Data
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -419,17 +419,17 @@ function testAccessibleTree(aAccOrElmOrI
case "absentAttributes":
testAbsentAttrs(acc, accTree[prop]);
break;
case "interfaces": {
var ifaces = (accTree[prop] instanceof Array) ?
accTree[prop] : [ accTree[prop] ];
- for (var i = 0; i < ifaces.length; i++) {
+ for (let i = 0; i < ifaces.length; i++) {
ok((acc instanceof ifaces[i]),
"No " + ifaces[i] + " interface on " + prettyName(acc));
}
break;
}
case "relations": {
for (var rel in accTree[prop])
@@ -452,26 +452,26 @@ function testAccessibleTree(aAccOrElmOrI
case "tagName":
is(accTree[prop], acc.DOMNode.tagName, msg);
break;
case "textAttrs": {
var prevOffset = -1;
for (var offset in accTree[prop]) {
- if (prevOffset != - 1) {
- var attrs = accTree[prop][prevOffset];
+ if (prevOffset != -1) {
+ let attrs = accTree[prop][prevOffset];
testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, +offset, true);
}
prevOffset = +offset;
}
if (prevOffset != -1) {
var charCount = getAccessible(acc, [nsIAccessibleText]).characterCount;
- var attrs = accTree[prop][prevOffset];
+ let attrs = accTree[prop][prevOffset];
testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, charCount, true);
}
break;
}
default:
if (prop.indexOf("todo_") == 0)
@@ -482,17 +482,17 @@ function testAccessibleTree(aAccOrElmOrI
}
// Test children.
if ("children" in accTree && accTree.children instanceof Array) {
var children = acc.children;
var childCount = children.length;
if (accTree.children.length != childCount) {
- for (var i = 0; i < Math.max(accTree.children.length, childCount); i++) {
+ for (let i = 0; i < Math.max(accTree.children.length, childCount); i++) {
var accChild = null, testChild = null;
try {
testChild = accTree.children[i];
accChild = children.queryElementAt(i, nsIAccessible);
if (!testChild) {
ok(false, prettyName(acc) + " has an extra child at index " + i +
" : " + prettyName(accChild));
@@ -511,18 +511,18 @@ function testAccessibleTree(aAccOrElmOrI
} catch (e) {
ok(false, prettyName(accTree) + " is expected to have a child at index " + i +
" : " + prettyName(testChild) + ", original tested: " +
prettyName(aAccOrElmOrID) + ", " + e);
}
}
} else {
if (aFlags & kSkipTreeFullCheck) {
- for (var i = 0; i < childCount; i++) {
- var child = children.queryElementAt(i, nsIAccessible);
+ for (let i = 0; i < childCount; i++) {
+ let child = children.queryElementAt(i, nsIAccessible);
testAccessibleTree(child, accTree.children[i], aFlags);
}
return;
}
// nsIAccessible::firstChild
var expectedFirstChild = childCount > 0 ?
children.queryElementAt(0, nsIAccessible) : null;
@@ -535,17 +535,17 @@ function testAccessibleTree(aAccOrElmOrI
var expectedLastChild = childCount > 0 ?
children.queryElementAt(childCount - 1, nsIAccessible) : null;
var lastChild = null;
try { lastChild = acc.lastChild; } catch (e) {}
is(lastChild, expectedLastChild,
"Wrong last child of " + prettyName(acc));
for (var i = 0; i < childCount; i++) {
- var child = children.queryElementAt(i, nsIAccessible);
+ let child = children.queryElementAt(i, nsIAccessible);
// nsIAccessible::parent
var parent = null;
try { parent = child.parent; } catch (e) {}
is(parent, acc, "Wrong parent of " + prettyName(child));
// nsIAccessible::indexInParent
var indexInParent = -1;
@@ -705,32 +705,27 @@ function getLoadContext() {
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
}
/**
* Return text from clipboard.
*/
function getTextFromClipboard() {
- var clip = Components.classes["@mozilla.org/widget/clipboard;1"].
- getService(Components.interfaces.nsIClipboard);
- if (!clip)
- return "";
-
var trans = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
trans.init(getLoadContext());
if (!trans)
return "";
trans.addDataFlavor("text/unicode");
- clip.getData(trans, clip.kGlobalClipboard);
+ Services.clipboard.getData(trans, Services.clipboard.kGlobalClipboard);
- var str = new Object();
- var strLength = new Object();
+ var str = {};
+ var strLength = {};
trans.getTransferData("text/unicode", str, strLength);
if (str)
str = str.value.QueryInterface(Components.interfaces.nsISupportsString);
if (str)
return str.data.substring(0, strLength.value / 2);
return "";
@@ -761,30 +756,30 @@ function getAccessibleDOMNodeID(accessib
} catch (e) { /* This will fail if accessible is not a proxy. */ }
}
/**
* Return pretty name for identifier, it may be ID, DOM node or accessible.
*/
function prettyName(aIdentifier) {
if (aIdentifier instanceof Array) {
- var msg = "";
+ let msg = "";
for (var idx = 0; idx < aIdentifier.length; idx++) {
if (msg != "")
msg += ", ";
msg += prettyName(aIdentifier[idx]);
}
return msg;
}
if (aIdentifier instanceof nsIAccessible) {
var acc = getAccessible(aIdentifier);
var domID = getAccessibleDOMNodeID(acc);
- var msg = "[";
+ let msg = "[";
try {
if (Services.appinfo.browserTabsRemoteAutostart) {
if (domID) {
msg += `DOM node id: ${domID}, `;
}
} else {
msg += `${getNodePrettyName(acc.DOMNode)}, `;
}
--- a/accessible/tests/mochitest/editabletext/editabletext.js
+++ b/accessible/tests/mochitest/editabletext/editabletext.js
@@ -57,74 +57,74 @@ function editableTextTest(aID) {
dump(`\nsetTextContents '${aValue}'\n`);
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.setTextContents(aValue);
}
aSkipStartOffset = aSkipStartOffset || 0;
var insertTripple = aValue ?
[ aSkipStartOffset, aSkipStartOffset + aValue.length, aValue ] : null;
- var oldValue = getValue(aID);
+ var oldValue = getValue();
var removeTripple = oldValue ?
[ aSkipStartOffset, aSkipStartOffset + oldValue.length, oldValue ] : null;
- this.generateTest(aID, removeTripple, insertTripple, setTextContentsInvoke,
- getValueChecker(aID, aValue), testID);
+ this.generateTest(removeTripple, insertTripple, setTextContentsInvoke,
+ getValueChecker(aValue), testID);
};
/**
* insertText test.
*/
this.insertText = function insertText(aStr, aPos, aResStr, aResPos) {
var testID = "insertText '" + aStr + "' at " + aPos + " for " +
prettyName(aID);
function insertTextInvoke() {
dump(`\ninsertText '${aStr}' at ${aPos} pos\n`);
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.insertText(aStr, aPos);
}
var resPos = (aResPos != undefined) ? aResPos : aPos;
- this.generateTest(aID, null, [resPos, resPos + aStr.length, aStr],
- insertTextInvoke, getValueChecker(aID, aResStr), testID);
+ this.generateTest(null, [resPos, resPos + aStr.length, aStr],
+ insertTextInvoke, getValueChecker(aResStr), testID);
};
/**
* copyText test.
*/
this.copyText = function copyText(aStartPos, aEndPos, aClipboardStr) {
var testID = "copyText from " + aStartPos + " to " + aEndPos + " for " +
prettyName(aID);
function copyTextInvoke() {
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.copyText(aStartPos, aEndPos);
}
- this.generateTest(aID, null, null, copyTextInvoke,
- getClipboardChecker(aID, aClipboardStr), testID);
+ this.generateTest(null, null, copyTextInvoke,
+ getClipboardChecker(aClipboardStr), testID);
};
/**
* copyText and pasteText test.
*/
this.copyNPasteText = function copyNPasteText(aStartPos, aEndPos,
aPos, aResStr) {
var testID = "copyText from " + aStartPos + " to " + aEndPos +
"and pasteText at " + aPos + " for " + prettyName(aID);
function copyNPasteTextInvoke() {
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.copyText(aStartPos, aEndPos);
acc.pasteText(aPos);
}
- this.generateTest(aID, null, [aStartPos, aEndPos, getTextFromClipboard],
- copyNPasteTextInvoke, getValueChecker(aID, aResStr), testID);
+ this.generateTest(null, [aStartPos, aEndPos, getTextFromClipboard],
+ copyNPasteTextInvoke, getValueChecker(aResStr), testID);
};
/**
* cutText test.
*/
this.cutText = function cutText(aStartPos, aEndPos, aResStr,
aResStartPos, aResEndPos) {
var testID = "cutText from " + aStartPos + " to " + aEndPos + " for " +
@@ -132,101 +132,101 @@ function editableTextTest(aID) {
function cutTextInvoke() {
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.cutText(aStartPos, aEndPos);
}
var resStartPos = (aResStartPos != undefined) ? aResStartPos : aStartPos;
var resEndPos = (aResEndPos != undefined) ? aResEndPos : aEndPos;
- this.generateTest(aID, [resStartPos, resEndPos, getTextFromClipboard], null,
- cutTextInvoke, getValueChecker(aID, aResStr), testID);
+ this.generateTest([resStartPos, resEndPos, getTextFromClipboard], null,
+ cutTextInvoke, getValueChecker(aResStr), testID);
};
/**
* cutText and pasteText test.
*/
this.cutNPasteText = function copyNPasteText(aStartPos, aEndPos,
aPos, aResStr) {
var testID = "cutText from " + aStartPos + " to " + aEndPos +
" and pasteText at " + aPos + " for " + prettyName(aID);
function cutNPasteTextInvoke() {
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.cutText(aStartPos, aEndPos);
acc.pasteText(aPos);
}
- this.generateTest(aID, [aStartPos, aEndPos, getTextFromClipboard],
+ this.generateTest([aStartPos, aEndPos, getTextFromClipboard],
[aPos, -1, getTextFromClipboard],
- cutNPasteTextInvoke, getValueChecker(aID, aResStr),
+ cutNPasteTextInvoke, getValueChecker(aResStr),
testID);
};
/**
* pasteText test.
*/
this.pasteText = function pasteText(aPos, aResStr) {
var testID = "pasteText at " + aPos + " for " + prettyName(aID);
function pasteTextInvoke() {
var acc = getAccessible(aID, nsIAccessibleEditableText);
acc.pasteText(aPos);
}
- this.generateTest(aID, null, [aPos, -1, getTextFromClipboard],
- pasteTextInvoke, getValueChecker(aID, aResStr), testID);
+ this.generateTest(null, [aPos, -1, getTextFromClipboard],
+ pasteTextInvoke, getValueChecker(aResStr), testID);
};
/**
* deleteText test.
*/
this.deleteText = function deleteText(aStartPos, aEndPos, aResStr) {
var testID = "deleteText from " + aStartPos + " to " + aEndPos +
" for " + prettyName(aID);
- var oldValue = getValue(aID).substring(aStartPos, aEndPos);
+ var oldValue = getValue().substring(aStartPos, aEndPos);
var removeTripple = oldValue ? [aStartPos, aEndPos, oldValue] : null;
function deleteTextInvoke() {
var acc = getAccessible(aID, [nsIAccessibleEditableText]);
acc.deleteText(aStartPos, aEndPos);
}
- this.generateTest(aID, removeTripple, null, deleteTextInvoke,
- getValueChecker(aID, aResStr), testID);
+ this.generateTest(removeTripple, null, deleteTextInvoke,
+ getValueChecker(aResStr), testID);
};
// ////////////////////////////////////////////////////////////////////////////
// Implementation details.
- function getValue(aID) {
+ function getValue() {
var elm = getNode(aID);
if (elm instanceof Components.interfaces.nsIDOMNSEditableElement)
return elm.value;
if (elm instanceof Components.interfaces.nsIDOMHTMLDocument)
return elm.body.textContent;
return elm.textContent;
}
/**
* Common checkers.
*/
- function getValueChecker(aID, aValue) {
+ function getValueChecker(aValue) {
var checker = {
check: function valueChecker_check() {
- is(getValue(aID), aValue, "Wrong value " + aValue);
+ is(getValue(), aValue, "Wrong value " + aValue);
}
};
return checker;
}
- function getClipboardChecker(aID, aText) {
+ function getClipboardChecker(aText) {
var checker = {
check: function clipboardChecker_check() {
is(getTextFromClipboard(), aText, "Wrong text in clipboard.");
}
};
return checker;
}
@@ -237,41 +237,41 @@ function editableTextTest(aID) {
var data = this.mEventQueue.mInvokers[this.mEventQueue.mIndex + 1];
if (data)
data.func.apply(this, data.funcArgs);
};
/**
* Used to generate an invoker object for the sheduled test.
*/
- this.generateTest = function generateTest(aID, aRemoveTriple, aInsertTriple,
+ this.generateTest = function generateTest(aRemoveTriple, aInsertTriple,
aInvokeFunc, aChecker, aInvokerID) {
var et = this;
var invoker = {
eventSeq: [],
invoke: aInvokeFunc,
finalCheck: function finalCheck() {
// dumpTree(aID, `'${aID}' tree:`);
aChecker.check();
et.unwrapNextTest(); // replace dummy invoker on real invoker object.
},
getID: function getID() { return aInvokerID; }
};
if (aRemoveTriple) {
- var checker = new textChangeChecker(aID, aRemoveTriple[0],
+ let checker = new textChangeChecker(aID, aRemoveTriple[0],
aRemoveTriple[1], aRemoveTriple[2],
false);
invoker.eventSeq.push(checker);
}
if (aInsertTriple) {
- var checker = new textChangeChecker(aID, aInsertTriple[0],
+ let checker = new textChangeChecker(aID, aInsertTriple[0],
aInsertTriple[1], aInsertTriple[2],
true);
invoker.eventSeq.push(checker);
}
// Claim that we don't want to fail when no events are expected.
if (!aRemoveTriple && !aInsertTriple)
invoker.noEventsOnAction = true;
--- a/accessible/tests/mochitest/elm/a11y.ini
+++ b/accessible/tests/mochitest/elm/a11y.ini
@@ -10,8 +10,9 @@ skip-if = buildapp == 'mulet'
[test_listbox.xul]
[test_MathMLSpec.html]
[test_nsApplicationAcc.html]
[test_plugin.html]
skip-if = buildapp == 'mulet'
[test_canvas.html]
[test_shadowroot.html]
skip-if = stylo # bug 1293844
+support-files = test_shadowroot_subframe.html
--- a/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
+++ b/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
@@ -1,59 +1,54 @@
<html>
<head>
<title>application accessible name</title>
- <link rel="stylesheet" type="text/css"
+ <link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
- <script type="application/javascript"
+ <script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
+ <script type="application/javascript"
src="../common.js"></script>
- <script type="application/javascript"
+ <script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript">
+ /* import-globals-from ../common.js */
function doTest() {
var accessible = getApplicationAccessible();
if (!accessible) {
SimpleTest.finish();
return;
}
- var bundleServ =
- Components.classes["@mozilla.org/intl/stringbundle;1"].
- getService(Components.interfaces.nsIStringBundleService);
var brandBundle =
- bundleServ.createBundle("chrome://branding/locale/brand.properties");
-
- var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
- getService(Components.interfaces.nsIXULAppInfo);
+ Services.strings.createBundle("chrome://branding/locale/brand.properties");
// nsIAccessible::name
var applicationName = "";
if (LINUX || SOLARIS) {
- applicationName = appInfo.name;
+ applicationName = Services.appinfo.name;
} else {
try {
applicationName = brandBundle.GetStringFromName("brandShortName");
} catch (e) {
}
if (applicationName == "")
applicationName = "Gecko based application";
}
is(accessible.name, applicationName, "wrong application accessible name");
// nsIAccessibleApplication
- is(accessible.appName, appInfo.name, "Wrong application name");
- is(accessible.appVersion, appInfo.version, "Wrong application version");
+ is(accessible.appName, Services.appinfo.name, "Wrong application name");
+ is(accessible.appVersion, Services.appinfo.version, "Wrong application version");
is(accessible.platformName, "Gecko", "Wrong platform name");
- is(accessible.platformVersion, appInfo.platformVersion,
+ is(accessible.platformVersion, Services.appinfo.platformVersion,
"Wrong platform version");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
--- a/accessible/tests/mochitest/elm/test_shadowroot.html
+++ b/accessible/tests/mochitest/elm/test_shadowroot.html
@@ -3,57 +3,38 @@
<head>
<title>ShadowRoot tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="../common.js"></script>
- <script type="application/javascript"
- src="../role.js"></script>
-
- <script type="application/javascript">
- function doTest() {
- testElm("component", {
- role: ROLE_GROUPING,
- children: [
- {
- role: ROLE_PUSHBUTTON,
- },
- {
- role: ROLE_LINK,
- },
- ]
- });
-
- SimpleTest.finish();
- }
-
- SimpleTest.waitForExplicitFinish();
- addA11yLoadEvent(doTest);
- </script>
</head>
<body>
<a target="_blank"
title="Ensure accessible objects are created for shadow root"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026125">
Mozilla Bug 1026125
</a><br/>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
- <div role="group" id="component"></div>
<script>
- var component = document.getElementById("component");
- var shadow = component.createShadowRoot();
-
- shadow.innerHTML = "<button>Hello</button>" +
- '<a href="#"> World</a>';
+ SimpleTest.waitForExplicitFinish();
+ SpecialPowers.pushPrefEnv({
+ set: [
+ ["dom.webcomponents.shadowdom.enabled", true]
+ ]
+ }, function() {
+ // This test loads in an iframe, to ensure that the element instance is
+ // loaded with the correct value of the preference.
+ var iframe = document.createElement("iframe");
+ iframe.src = "test_shadowroot_subframe.html";
+ document.body.appendChild(iframe);
+ });
</script>
</body>
</html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/elm/test_shadowroot_subframe.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>ShadowRoot tests</title>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+ <script type="application/javascript" src="../common.js"></script>
+ <script type="application/javascript" src="../role.js"></script>
+
+ <script type="application/javascript">
+ let SimpleTest = window.parent.SimpleTest;
+ let ok = window.parent.ok;
+ let is = window.parent.is;
+
+ function doTest() {
+ testElm("component", {
+ role: ROLE_GROUPING,
+ children: [
+ {
+ role: ROLE_PUSHBUTTON,
+ },
+ {
+ role: ROLE_LINK,
+ },
+ ]
+ });
+
+ SimpleTest.finish();
+ }
+
+ addA11yLoadEvent(doTest);
+ </script>
+
+</head>
+<body>
+ <div role="group" id="component"></div>
+ <script>
+ var component = document.getElementById("component");
+ var shadow = component.attachShadow({mode: "open"});
+
+ shadow.innerHTML = "<button>Hello</button>" +
+ '<a href="#"> World</a>';
+ </script>
+</body>
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -1,8 +1,11 @@
+// XXX Bug 1425371 - enable no-redeclare and fix the issues with the tests.
+/* eslint-disable no-redeclare */
+
// //////////////////////////////////////////////////////////////////////////////
// Constants
const EVENT_ALERT = nsIAccessibleEvent.EVENT_ALERT;
const EVENT_DESCRIPTION_CHANGE = nsIAccessibleEvent.EVENT_DESCRIPTION_CHANGE;
const EVENT_DOCUMENT_LOAD_COMPLETE = nsIAccessibleEvent.EVENT_DOCUMENT_LOAD_COMPLETE;
const EVENT_DOCUMENT_RELOAD = nsIAccessibleEvent.EVENT_DOCUMENT_RELOAD;
const EVENT_DOCUMENT_LOAD_STOPPED = nsIAccessibleEvent.EVENT_DOCUMENT_LOAD_STOPPED;
@@ -331,22 +334,20 @@ function eventQueue(aEventType) {
var checker = eventSeq[idx];
var typeStr = eventQueue.getEventTypeAsString(checker);
var msg = "Test with ID = '" + this.getEventID(checker) +
"' succeed. ";
if (checker.unexpected) {
ok(true, msg + `There's no unexpected '${typeStr}' event.`);
+ } else if (checker.todo) {
+ todo(false, `Todo event '${typeStr}' was caught`);
} else {
- if (checker.todo) {
- todo(false, `Todo event '${typeStr}' was caught`);
- } else {
- ok(true, `${msg} Event '${typeStr}' was handled.`);
- }
+ ok(true, `${msg} Event '${typeStr}' was handled.`);
}
}
}
}
}
// We don't have completely matched scenario. Report each failure/success
// for every scenario.
@@ -1996,16 +1997,17 @@ var gA11yEventObserver =
function listenA11yEvents(aStartToListen) {
if (aStartToListen) {
// Add observer when adding the first applicant only.
if (!(gA11yEventApplicantsCount++))
Services.obs.addObserver(gA11yEventObserver, "accessible-event");
} else {
// Remove observer when there are no more applicants only.
// '< 0' case should not happen, but just in case: removeObserver() will throw.
+ // eslint-disable-next-line no-lonely-if
if (--gA11yEventApplicantsCount <= 0)
Services.obs.removeObserver(gA11yEventObserver, "accessible-event");
}
}
function addA11yEventListener(aEventType, aEventHandler) {
if (!(aEventType in gA11yEventListeners))
gA11yEventListeners[aEventType] = [];
@@ -2115,17 +2117,17 @@ var gLogger =
Services.console.logStringMessage("events: " + aMsg);
},
/**
* Return true if logging feature is enabled.
*/
hasFeature: function logger_hasFeature(aFeature) {
var startIdx = gA11yEventDumpFeature.indexOf(aFeature);
- if (startIdx == - 1)
+ if (startIdx == -1)
return false;
var endIdx = startIdx + aFeature.length;
return endIdx == gA11yEventDumpFeature.length ||
gA11yEventDumpFeature[endIdx] == ";";
}
};
--- a/accessible/tests/mochitest/events/test_aria_objattr.html
+++ b/accessible/tests/mochitest/events/test_aria_objattr.html
@@ -38,17 +38,17 @@
return aAttr + " for " + aID + " " + aValue;
};
}
function updateARIAHidden(aID, aIsDefined, aChildId) {
this.__proto__ = new updateAttribute(aID, "aria-hidden",
aIsDefined ? "true" : "false");
- this.finalCheck = function updateARIAHidden() {
+ this.finalCheck = function updateARIAHidden_finalCheck() {
if (aIsDefined) {
testAttrs(aID, {"hidden": "true"}, true);
testAttrs(aChildId, {"hidden": "true"}, true);
} else {
testAbsentAttrs(aID, { "hidden": "true"});
testAbsentAttrs(aChildId, { "hidden": "true"});
}
};
--- a/accessible/tests/mochitest/events/test_attrs.html
+++ b/accessible/tests/mochitest/events/test_attrs.html
@@ -44,22 +44,22 @@
// gA11yEventDumpID = "eventdump"; // debug stuff
// gA11yEventDumpToConsole = true; // debug stuff
function doTests() {
gQueue = new eventQueue();
var id = "textbox", noTargetId = "textarea";
- var checker =
+ let checker =
new eventFromInputChecker(EVENT_FOCUS, id, "false", noTargetId);
gQueue.push(new synthFocus(id, checker));
if (!MAC) { // Mac failure is bug 541093
- var checker =
+ checker =
new eventFromInputChecker(EVENT_TEXT_CARET_MOVED, id, "true", noTargetId);
gQueue.push(new synthHomeKey(id, checker));
}
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/events/test_dragndrop.html
+++ b/accessible/tests/mochitest/events/test_dragndrop.html
@@ -61,23 +61,23 @@
return prettyName(aNodeOrID) + " aria-dropeffect changed";
};
}
function doTests() {
// Test aria attribute mutation events
gQueue = new eventQueue(nsIAccessibleEvent.EVENT_OBJECT_ATTRIBUTE_CHANGED);
- var id = "grabbable";
+ let id = "grabbable";
gQueue.push(new changeGrabbed(id, "true"));
gQueue.push(new changeGrabbed(id, "false"));
todo(false, "uncomment this test when 472142 is fixed.");
// gQueue.push(new changeGrabbed(id, "undefined"));
- var id = "dropregion";
+ id = "dropregion";
gQueue.push(new changeDropeffect(id, "copy"));
gQueue.push(new changeDropeffect(id, "execute"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTests);
--- a/accessible/tests/mochitest/events/test_flush.html
+++ b/accessible/tests/mochitest/events/test_flush.html
@@ -15,17 +15,17 @@
src="../common.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
SimpleTest.expectAssertions(0, 1);
var gFocusHandler = {
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (this.count) {
case 0:
is(aEvent.DOMNode, getNode("input1"),
"Focus event for input1 was expected!");
getAccessible("input2").takeFocus();
break;
case 1:
--- a/accessible/tests/mochitest/events/test_focus_general.html
+++ b/accessible/tests/mochitest/events/test_focus_general.html
@@ -101,20 +101,19 @@
gQueue.push(new toggleTopMenu(editableDoc, new topMenuChecker()));
gQueue.push(new toggleTopMenu(editableDoc, new focusChecker(editableDoc)));
}
gQueue.push(new synthContextMenu(editableDoc, new contextMenuChecker()));
gQueue.push(new synthDownKey(editableDoc, new focusContextMenuItemChecker()));
gQueue.push(new synthEscapeKey(editableDoc, new focusChecker(editableDoc)));
if (SEAMONKEY) {
todo(false, "shift tab from editable document fails on (Windows) SeaMonkey! (Bug 718235)");
+ } else if (LINUX || MAC) {
+ todo(false, "shift tab from editable document fails on linux and Mac, bug 746519!");
} else {
- if (LINUX || MAC)
- todo(false, "shift tab from editable document fails on linux and Mac, bug 746519!");
- else
gQueue.push(new synthShiftTab("link", new focusChecker("link")));
} // ! SEAMONKEY
gQueue.push(new synthFocus("a", new imageMapChecker("a")));
gQueue.push(new synthFocus("b", new imageMapChecker("b")));
gQueue.invoke(); // Will call SimpleTest.finish();
}
--- a/accessible/tests/mochitest/events/test_mutation.html
+++ b/accessible/tests/mochitest/events/test_mutation.html
@@ -66,17 +66,17 @@
* Replace the default target currently registered for a given event type
* with the nodes in the targets array.
*/
this.setTargets = function mutateA11yTree_setTargets(aEventType, aTargets) {
var targetIdx = this.setTarget(aEventType, aTargets[0]);
var type = this.getA11yEventType(aEventType);
for (var i = 1; i < aTargets.length; i++) {
- var checker = new invokerChecker(type, aTargets[i]);
+ let checker = new invokerChecker(type, aTargets[i]);
this.getEventSeq().splice(++targetIdx, 0, checker);
}
};
// Implementation
this.getA11yEventType = function mutateA11yTree_getA11yEventType(aEventType) {
if (aEventType == kReorderEvent)
return nsIAccessibleEvent.EVENT_REORDER;
@@ -88,29 +88,29 @@
return nsIAccessibleEvent.EVENT_SHOW;
};
this.getEventSeq = function mutateA11yTree_getEventSeq() {
return this.doNotExpectEvents ? this.unexpectedEventSeq : this.eventSeq;
};
if (aEventTypes & kHideEvent) {
- var checker = new invokerChecker(this.getA11yEventType(kHideEvent),
+ let checker = new invokerChecker(this.getA11yEventType(kHideEvent),
this.DOMNode);
this.getEventSeq().push(checker);
}
if (aEventTypes & kShowEvent) {
- var checker = new invokerChecker(this.getA11yEventType(kShowEvent),
+ let checker = new invokerChecker(this.getA11yEventType(kShowEvent),
this.DOMNode);
this.getEventSeq().push(checker);
}
if (aEventTypes & kReorderEvent) {
- var checker = new invokerChecker(this.getA11yEventType(kReorderEvent),
+ let checker = new invokerChecker(this.getA11yEventType(kReorderEvent),
this.DOMNode.parentNode);
this.getEventSeq().push(checker);
}
}
/**
* Change CSS style for the given node.
*/
@@ -427,61 +427,61 @@
*/
var gQueue = null;
function doTests() {
gQueue = new eventQueue();
// Show/hide events by changing of display style of accessible DOM node
// from 'inline' to 'none', 'none' to 'inline'.
- var id = "link1";
+ let id = "link1";
getAccessible(id); // ensure accessible is created
gQueue.push(new changeStyle(id, "display", "none", kHideEvents));
gQueue.push(new changeStyle(id, "display", "inline", kShowEvents));
// Show/hide events by changing of visibility style of accessible DOM node
// from 'visible' to 'hidden', 'hidden' to 'visible'.
- var id = "link2";
+ id = "link2";
getAccessible(id);
gQueue.push(new changeStyle(id, "visibility", "hidden", kHideEvents));
gQueue.push(new changeStyle(id, "visibility", "visible", kShowEvents));
// Show/hide events by changing of display style of accessible DOM node
// from 'inline' to 'block', 'block' to 'inline'.
- var id = "link3";
+ id = "link3";
getAccessible(id); // ensure accessible is created
gQueue.push(new changeStyle(id, "display", "block", kHideAndShowEvents));
gQueue.push(new changeStyle(id, "display", "inline", kHideAndShowEvents));
// Show/hide events by changing of visibility style of accessible DOM node
// from 'collapse' to 'visible', 'visible' to 'collapse'.
- var id = "link4";
+ id = "link4";
gQueue.push(new changeStyle(id, "visibility", "visible", kShowEvents));
gQueue.push(new changeStyle(id, "visibility", "collapse", kHideEvents));
// Show/hide events by adding new accessible DOM node and removing old one.
- var id = "link5";
+ id = "link5";
gQueue.push(new cloneAndAppendToDOM(id));
gQueue.push(new removeFromDOM(id));
// No show/hide events by adding new not accessible DOM node and removing
// old one, no reorder event for their parent.
- var id = "child1";
+ id = "child1";
gQueue.push(new cloneAndAppendToDOM(id, kNoEvents));
gQueue.push(new removeFromDOM(id, kNoEvents));
// Show/hide events by adding new accessible DOM node and removing
// old one, there is reorder event for their parent.
- var id = "child2";
+ id = "child2";
gQueue.push(new cloneAndAppendToDOM(id));
gQueue.push(new removeFromDOM(id));
// Show/hide events by adding new DOM node containing accessible DOM and
// removing old one, there is reorder event for their parent.
- var id = "child3";
+ id = "child3";
gQueue.push(new cloneAndAppendToDOM(id, kShowEvents, getFirstChild,
getParent));
// Hide event for accessible child of unaccessible removed DOM node and
// reorder event for its parent.
gQueue.push(new removeFromDOM(id, kHideEvents,
getNEnsureFirstChild, getParent));
--- a/accessible/tests/mochitest/events/test_statechange.html
+++ b/accessible/tests/mochitest/events/test_statechange.html
@@ -29,19 +29,19 @@
// Note: this should fire an EVENT_STATE_CHANGE
this.DOMNode.designMode = "on";
};
this.check = function editabledoc_check(aEvent) {
testStates(aDocNode, 0, EXT_STATE_EDITABLE);
- var event = null;
+ let event = null;
try {
- var event = aEvent.QueryInterface(nsIAccessibleStateChangeEvent);
+ event = aEvent.QueryInterface(nsIAccessibleStateChangeEvent);
} catch (e) {
ok(false, "State change event was expected");
}
if (!event) { return; }
ok(event.isExtraState, "Extra state change was expected");
is(event.state, EXT_STATE_EDITABLE, "Wrong state of statechange event");
--- a/accessible/tests/mochitest/events/test_text.html
+++ b/accessible/tests/mochitest/events/test_text.html
@@ -59,35 +59,35 @@
* Insert inaccessible child node containing accessibles.
*/
function insertChildSpan(aID, aInsertAllTogether) {
this.__proto__ = new textInsertInvoker(aID, 0, 5, "33322");
this.invoke = function insertChildSpan_invoke() {
// <span><span>333</span><span>22</span></span>
if (aInsertAllTogether) {
- var topSpan = document.createElement("span");
- var fSpan = document.createElement("span");
+ let topSpan = document.createElement("span");
+ let fSpan = document.createElement("span");
fSpan.textContent = "333";
topSpan.appendChild(fSpan);
- var sSpan = document.createElement("span");
+ let sSpan = document.createElement("span");
sSpan.textContent = "22";
topSpan.appendChild(sSpan);
this.DOMNode.insertBefore(topSpan, this.DOMNode.childNodes[0]);
} else {
- var topSpan = document.createElement("span");
+ let topSpan = document.createElement("span");
this.DOMNode.insertBefore(topSpan, this.DOMNode.childNodes[0]);
- var fSpan = document.createElement("span");
+ let fSpan = document.createElement("span");
fSpan.textContent = "333";
topSpan.appendChild(fSpan);
- var sSpan = document.createElement("span");
+ let sSpan = document.createElement("span");
sSpan.textContent = "22";
topSpan.appendChild(sSpan);
}
};
this.getID = function insertChildSpan_getID() {
return "Insert inaccessible span containing accessibles" +
prettyName(aID);
--- a/accessible/tests/mochitest/grid.js
+++ b/accessible/tests/mochitest/grid.js
@@ -66,59 +66,60 @@ function grid(aTableIdentifier) {
};
this.handleKeyEvent = function handleKeyEvent(aEvent) {
if (aEvent.target.localName != "td")
return;
var cell = aEvent.target;
switch (aEvent.keyCode) {
- case nsIDOMKeyEvent.DOM_VK_UP:
- var colsCount = this.getColsCount();
- var idx = this.getIndexByCell(cell);
+ case nsIDOMKeyEvent.DOM_VK_UP: {
+ let colsCount = this.getColsCount();
+ let idx = this.getIndexByCell(cell);
var upidx = idx - colsCount;
if (upidx >= 0) {
cell.removeAttribute("tabindex");
var upcell = this.getCellAtIndex(upidx);
upcell.setAttribute("tabindex", "0");
upcell.focus();
}
break;
-
- case nsIDOMKeyEvent.DOM_VK_DOWN:
- var colsCount = this.getColsCount();
- var idx = this.getIndexByCell(cell);
+ }
+ case nsIDOMKeyEvent.DOM_VK_DOWN: {
+ let colsCount = this.getColsCount();
+ let idx = this.getIndexByCell(cell);
var downidx = idx + colsCount;
if (downidx <= this.getMaxIndex()) {
cell.removeAttribute("tabindex");
var downcell = this.getCellAtIndex(downidx);
downcell.setAttribute("tabindex", "0");
downcell.focus();
}
break;
-
- case nsIDOMKeyEvent.DOM_VK_LEFT:
- var idx = this.getIndexByCell(cell);
+ }
+ case nsIDOMKeyEvent.DOM_VK_LEFT: {
+ let idx = this.getIndexByCell(cell);
if (idx > 0) {
cell.removeAttribute("tabindex");
var prevcell = this.getCellAtIndex(idx - 1);
prevcell.setAttribute("tabindex", "0");
prevcell.focus();
}
break;
-
- case nsIDOMKeyEvent.DOM_VK_RIGHT:
- var idx = this.getIndexByCell(cell);
+ }
+ case nsIDOMKeyEvent.DOM_VK_RIGHT: {
+ let idx = this.getIndexByCell(cell);
if (idx < this.getMaxIndex()) {
cell.removeAttribute("tabindex");
var nextcell = this.getCellAtIndex(idx + 1);
nextcell.setAttribute("tabindex", "0");
nextcell.focus();
}
break;
+ }
}
};
this.handleClickEvent = function handleClickEvent(aEvent) {
if (aEvent.target.localName != "td")
return;
var curCell = this.getCurrentCell();
--- a/accessible/tests/mochitest/hittest/a11y.ini
+++ b/accessible/tests/mochitest/hittest/a11y.ini
@@ -4,11 +4,12 @@ support-files = zoom_tree.xul
!/accessible/tests/mochitest/letters.gif
[test_browser.html]
[test_canvas_hitregion.html]
skip-if = (os == "android" || appname == "b2g")
[test_general.html]
[test_menu.xul]
[test_shadowroot.html]
+support-files = test_shadowroot_subframe.html
[test_zoom.html]
[test_zoom_text.html]
[test_zoom_tree.xul]
--- a/accessible/tests/mochitest/hittest/test_shadowroot.html
+++ b/accessible/tests/mochitest/hittest/test_shadowroot.html
@@ -3,70 +3,38 @@
<head>
<title>ShadowRoot hit tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="../common.js"></script>
- <script type="application/javascript"
- src="../layout.js"></script>
-
- <script type="application/javascript">
- function doTest() {
- var componentAcc = getAccessible("component1");
- testChildAtPoint(componentAcc, 1, 1, componentAcc.firstChild,
- componentAcc.firstChild);
-
- componentAcc = getAccessible("component2");
- testChildAtPoint(componentAcc, 1, 1, componentAcc.firstChild,
- componentAcc.firstChild);
- SimpleTest.finish();
- }
-
- SimpleTest.waitForExplicitFinish();
- addA11yLoadEvent(doTest);
- </script>
</head>
<body>
<a target="_blank"
title="Test getChildAtPoint works for shadow DOM content"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1027315">
Mozilla Bug 1027315
</a><br/>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
- <div role="group" class="components" id="component1" style="display: inline-block;">
- <!--
- <div role="button" id="component-child"
- style="width: 100px; height: 100px; background-color: pink;">
- </div>
- -->
- </div>
- <div role="group" class="components" id="component2" style="display: inline-block;">
- <!--
- <button>Hello world</button>
- -->
- </div>
<script>
- // This routine adds the comment children of each 'component' to its
- // shadow root.
- var components = document.querySelectorAll(".components");
- for (var i = 0; i < components.length; i++) {
- var component = components[i];
- var shadow = component.createShadowRoot();
- for (var child = component.firstChild; child; child = child.nextSibling) {
- if (child.nodeType === 8)
- // eslint-disable-next-line no-unsanitized/property
- shadow.innerHTML = child.data;
- }
- }
+ SimpleTest.waitForExplicitFinish();
+ SpecialPowers.pushPrefEnv({
+ set: [
+ ["dom.webcomponents.shadowdom.enabled", true]
+ ]
+ }, function() {
+ // This test loads in an iframe, to ensure that the element instance is
+ // loaded with the correct value of the preference.
+ var iframe = document.createElement("iframe");
+ iframe.src = "test_shadowroot_subframe.html";
+ document.body.appendChild(iframe);
+ });
</script>
</body>
</html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/hittest/test_shadowroot_subframe.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>ShadowRoot hit tests</title>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+ <script type="application/javascript" src="../common.js"></script>
+ <script type="application/javascript" src="../layout.js"></script>
+
+ <script type="application/javascript">
+ let SimpleTest = window.parent.SimpleTest;
+ let ok = window.parent.ok;
+ let is = window.parent.is;
+
+ function doTest() {
+ var componentAcc = getAccessible("component1");
+ testChildAtPoint(componentAcc, 1, 1, componentAcc.firstChild,
+ componentAcc.firstChild);
+
+ componentAcc = getAccessible("component2");
+ testChildAtPoint(componentAcc, 1, 1, componentAcc.firstChild,
+ componentAcc.firstChild);
+ SimpleTest.finish();
+ }
+
+ SimpleTest.waitForExplicitFinish();
+ addA11yLoadEvent(doTest);
+ </script>
+
+</head>
+<body>
+ <div role="group" class="components" id="component1" style="display: inline-block;">
+ <!--
+ <div role="button" id="component-child"
+ style="width: 100px; height: 100px; background-color: pink;">
+ </div>
+ -->
+ </div>
+ <div role="group" class="components" id="component2" style="display: inline-block;">
+ <!--
+ <button>Hello world</button>
+ -->
+ </div>
+ <script>
+ // This routine adds the comment children of each 'component' to its
+ // shadow root.
+ var components = document.querySelectorAll(".components");
+ for (var i = 0; i < components.length; i++) {
+ var component = components[i];
+ var shadow = component.attachShadow({mode: "open"});
+ for (var child = component.firstChild; child; child = child.nextSibling) {
+ if (child.nodeType === 8)
+ // eslint-disable-next-line no-unsanitized/property
+ shadow.innerHTML = child.data;
+ }
+ }
+ </script>
+</body>
+</html>
--- a/accessible/tests/mochitest/hittest/test_zoom_text.html
+++ b/accessible/tests/mochitest/hittest/test_zoom_text.html
@@ -14,24 +14,24 @@
src="../role.js"></script>
<script type="application/javascript"
src="../layout.js"></script>
<script type="application/javascript">
function doTest() {
var hyperText = getNode("paragraph");
var textNode = hyperText.firstChild;
- var [x, y, width, height] = getBounds(textNode);
+ let [x, y, width, height] = getBounds(textNode);
testOffsetAtPoint(hyperText, x + width / 2, y + height / 2,
COORDTYPE_SCREEN_RELATIVE,
hyperText.textContent.length / 2);
zoomDocument(document, 2.0);
- var [x, y, width, height] = getBounds(textNode);
+ [x, y, width, height] = getBounds(textNode);
testOffsetAtPoint(hyperText, x + width / 2, y + height / 2,
COORDTYPE_SCREEN_RELATIVE,
hyperText.textContent.length / 2);
zoomDocument(document, 1.0);
SimpleTest.finish();
}
--- a/accessible/tests/mochitest/hypertext/test_update.html
+++ b/accessible/tests/mochitest/hypertext/test_update.html
@@ -164,17 +164,17 @@
// gA11yEventDumpToConsole = true; // debug stuff
var gQueue = null;
function doTest() {
gQueue = new eventQueue();
gQueue.push(new addLinks("p1"));
gQueue.push(new updateText("p2"));
- gQueue.push(new removeChild("div1","div2",
+ gQueue.push(new removeChild("div1", "div2",
"hello my good friend", "hello friend"));
gQueue.push(new removeFirstChild("c4"));
gQueue.push(new removeLastChild("c5"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/jsat/jsatcommon.js
+++ b/accessible/tests/mochitest/jsat/jsatcommon.js
@@ -183,17 +183,17 @@ function AccessFuContentTest(aFuncResult
this.queue = aFuncResultPairs;
}
AccessFuContentTest.prototype = {
expected: [],
currentAction: null,
actionNum: -1,
- start: function(aFinishedCallback) {
+ start(aFinishedCallback) {
Logger.logLevel = Logger.DEBUG;
this.finishedCallback = aFinishedCallback;
var self = this;
// Get top content message manager, and set it up.
this.mms = [Utils.getMessageManager(currentBrowser())];
this.setupMessageManager(this.mms[0], function() {
// Get child message managers and set them up
@@ -215,34 +215,34 @@ AccessFuContentTest.prototype = {
self.pump();
}
});
}
}
});
},
- finish: function() {
+ finish() {
Logger.logLevel = Logger.INFO;
for (var mm of this.mms) {
mm.sendAsyncMessage("AccessFu:Stop");
mm.removeMessageListener("AccessFu:Present", this);
mm.removeMessageListener("AccessFu:Input", this);
mm.removeMessageListener("AccessFu:CursorCleared", this);
mm.removeMessageListener("AccessFu:Focused", this);
mm.removeMessageListener("AccessFu:AriaHidden", this);
mm.removeMessageListener("AccessFu:Ready", this);
mm.removeMessageListener("AccessFu:ContentStarted", this);
}
if (this.finishedCallback) {
this.finishedCallback();
}
},
- setupMessageManager: function(aMessageManager, aCallback) {
+ setupMessageManager(aMessageManager, aCallback) {
function contentScript() {
addMessageListener("AccessFuTest:Focus", function(aMessage) {
var elem = content.document.querySelector(aMessage.json.selector);
if (elem) {
if (aMessage.json.blur) {
elem.blur();
} else {
elem.focus();
@@ -266,17 +266,17 @@ AccessFuContentTest.prototype = {
});
aMessageManager.loadFrameScript(
"chrome://global/content/accessibility/content-script.js", false);
aMessageManager.loadFrameScript(
"data:,(" + contentScript.toString() + ")();", false);
},
- pump: function() {
+ pump() {
this.expected.shift();
if (this.expected.length) {
return;
}
var currentPair = this.queue.shift();
if (currentPair) {
@@ -294,17 +294,17 @@ AccessFuContentTest.prototype = {
if (!this.expected[0]) {
this.pump();
}
} else {
this.finish();
}
},
- receiveMessage: function(aMessage) {
+ receiveMessage(aMessage) {
var expected = this.expected[0];
if (!expected) {
return;
}
var actionsString = typeof this.currentAction === "function" ?
this.currentAction.name + "()" : JSON.stringify(this.currentAction);
@@ -495,23 +495,21 @@ ExpectedMessage.prototype.lazyCompare =
var expected = aExpected[attr];
var received = aReceived[attr];
if (typeof expected === "object") {
var [childMatches, childDelta] = this.lazyCompare(received, expected);
if (!childMatches) {
delta.push(attr + " [ " + childDelta + " ]");
matches = false;
}
- } else {
- if (received !== expected) {
- delta.push(
- attr + " [ expected " + JSON.stringify(expected) +
- " got " + JSON.stringify(received) + " ]");
- matches = false;
- }
+ } else if (received !== expected) {
+ delta.push(
+ attr + " [ expected " + JSON.stringify(expected) +
+ " got " + JSON.stringify(received) + " ]");
+ matches = false;
}
}
var msg = delta.length ? delta.join(" ") : "Structures lazily match";
return [matches, msg + " -- " + aInfo];
};
ExpectedMessage.prototype.is = function(aReceived, aInfo) {
--- a/accessible/tests/mochitest/jsat/test_content_integration.html
+++ b/accessible/tests/mochitest/jsat/test_content_integration.html
@@ -206,17 +206,17 @@
// aria-hidden element that the virtual cursor is positioned on
[ContentMessages.simpleMoveNext,
new ExpectedCursorChange(["Traversal Rule test document", "Phone status bar"])],
[ContentMessages.simpleMoveNext,
new ExpectedCursorChange(["Back", {"string": "pushbutton"}])],
[doc.defaultView.ariaHideBack,
new ExpectedCursorChange(
- ["such app", "wow", {"string": "headingLevel","args": [1]}])],
+ ["such app", "wow", {"string": "headingLevel", "args": [1]}])],
// Changing aria-hidden attribute twice and making sure that the event
// is fired only once when the actual change happens.
[doc.defaultView.ariaHideBack],
[doc.defaultView.ariaShowBack],
[ContentMessages.simpleMovePrevious,
new ExpectedCursorChange(["Back", {"string": "pushbutton"}])],
[ContentMessages.clearCursor, "AccessFu:CursorCleared"],
@@ -234,17 +234,17 @@
// aria-hidden element and auto Move
[ContentMessages.simpleMoveNext,
new ExpectedCursorChange(["Traversal Rule test document", "Phone status bar"])],
[doc.defaultView.ariaHideBack],
[ContentMessages.focusSelector("button#back", false),
// Must not speak Back button as it is aria-hidden
new ExpectedCursorChange(
- ["such app", "wow", {"string": "headingLevel","args": [1]}])],
+ ["such app", "wow", {"string": "headingLevel", "args": [1]}])],
[doc.defaultView.ariaShowBack],
[ContentMessages.focusSelector("button#back", true), null],
[ContentMessages.clearCursor, "AccessFu:CursorCleared"],
// Open dialog in outer doc, while cursor is also in outer doc
[ContentMessages.simpleMoveLast,
new ExpectedCursorChange(["Traversal Rule test document", "mover",
"medium", {"string": "slider"}])],
--- a/accessible/tests/mochitest/jsat/test_content_text.html
+++ b/accessible/tests/mochitest/jsat/test_content_text.html
@@ -142,17 +142,17 @@
new ExpectedCursorChange(
["So we don't get dessert?", {string: "label"}]),
new ExpectedAnnouncement("navigating"),
new ExpectedEditState({
editing: false,
multiline: false,
atStart: true,
atEnd: false
- },{ focused: "html" })
+ }, { focused: "html" })
],
[ContentMessages.simpleMoveNext,
new ExpectedCursorChange(
[{ string: "entry" }],
{ focused: "html"})],
[ContentMessages.activateCurrent(0),
new ExpectedClickAction(),
new ExpectedAnnouncement("editing"),
--- a/accessible/tests/mochitest/jsat/test_output_mathml.html
+++ b/accessible/tests/mochitest/jsat/test_output_mathml.html
@@ -14,162 +14,162 @@
src="jsatcommon.js"></script>
<script type="application/javascript">
function doTest() {
// Test the following accOrElmOrID.
var tests = [{
accOrElmOrID: "math-1",
expectedUtterance: [
- [{"string": "open-fence"},"(","x",",","y",{"string": "close-fence"},")"],
- ["(",{"string": "open-fence"},"x",",","y",")",{"string": "close-fence"}]
+ [{"string": "open-fence"}, "(", "x", ",", "y", {"string": "close-fence"}, ")"],
+ ["(", {"string": "open-fence"}, "x", ",", "y", ")", {"string": "close-fence"}]
],
expectedBraille: [
- [{"string": "open-fenceAbbr"},"(","x",",","y",{"string": "close-fenceAbbr"},")"],
- ["(",{"string": "open-fenceAbbr"},"x",",","y",")",{"string": "close-fenceAbbr"}]
+ [{"string": "open-fenceAbbr"}, "(", "x", ",", "y", {"string": "close-fenceAbbr"}, ")"],
+ ["(", {"string": "open-fenceAbbr"}, "x", ",", "y", ")", {"string": "close-fenceAbbr"}]
]
}, {
accOrElmOrID: "mfrac-1",
expectedUtterance: [
- [{"string": "mathmlfraction"},{"string": "numerator"},"a",{"string": "denominator"},"b"],
- ["a",{"string": "numerator"},"b",{"string": "denominator"},{"string": "mathmlfraction"}]
+ [{"string": "mathmlfraction"}, {"string": "numerator"}, "a", {"string": "denominator"}, "b"],
+ ["a", {"string": "numerator"}, "b", {"string": "denominator"}, {"string": "mathmlfraction"}]
],
expectedBraille: [
- [{"string": "mathmlfractionAbbr"},{"string": "numeratorAbbr"},"a",{"string": "denominatorAbbr"},"b"],
- ["a",{"string": "numeratorAbbr"},"b",{"string": "denominatorAbbr"},{"string": "mathmlfractionAbbr"}]
+ [{"string": "mathmlfractionAbbr"}, {"string": "numeratorAbbr"}, "a", {"string": "denominatorAbbr"}, "b"],
+ ["a", {"string": "numeratorAbbr"}, "b", {"string": "denominatorAbbr"}, {"string": "mathmlfractionAbbr"}]
]
}, {
accOrElmOrID: "mfrac-2",
expectedUtterance: [
- [{"string": "mathmlfractionwithoutbar"},{"string": "numerator"},"a",{"string": "denominator"},"b"],
- ["a",{"string": "numerator"},"b",{"string": "denominator"},{"string": "mathmlfractionwithoutbar"}]
+ [{"string": "mathmlfractionwithoutbar"}, {"string": "numerator"}, "a", {"string": "denominator"}, "b"],
+ ["a", {"string": "numerator"}, "b", {"string": "denominator"}, {"string": "mathmlfractionwithoutbar"}]
],
expectedBraille: [
- [{"string": "mathmlfractionwithoutbarAbbr"},{"string": "numeratorAbbr"},"a",{"string": "denominatorAbbr"},"b"],
- ["a",{"string": "numeratorAbbr"},"b",{"string": "denominatorAbbr"},{"string": "mathmlfractionwithoutbarAbbr"}]
+ [{"string": "mathmlfractionwithoutbarAbbr"}, {"string": "numeratorAbbr"}, "a", {"string": "denominatorAbbr"}, "b"],
+ ["a", {"string": "numeratorAbbr"}, "b", {"string": "denominatorAbbr"}, {"string": "mathmlfractionwithoutbarAbbr"}]
]
}, {
accOrElmOrID: "msub-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "subscript"},"b"],
- ["a",{"string": "base"},"b",{"string": "subscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "subscript"}, "b"],
+ ["a", {"string": "base"}, "b", {"string": "subscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "subscriptAbbr"},"b"],
- ["a",{"string": "baseAbbr"},"b",{"string": "subscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "subscriptAbbr"}, "b"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "subscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "msup-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "superscript"},"b"],
- ["a",{"string": "base"},"b",{"string": "superscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "superscript"}, "b"],
+ ["a", {"string": "base"}, "b", {"string": "superscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "superscriptAbbr"},"b"],
- ["a",{"string": "baseAbbr"},"b",{"string": "superscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "superscriptAbbr"}, "b"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "superscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "msubsup-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "subscript"},"b",{"string": "superscript"},"c"],
- ["a",{"string": "base"},"b",{"string": "subscript"},"c",{"string": "superscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "subscript"}, "b", {"string": "superscript"}, "c"],
+ ["a", {"string": "base"}, "b", {"string": "subscript"}, "c", {"string": "superscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "subscriptAbbr"},"b",{"string": "superscriptAbbr"},"c"],
- ["a",{"string": "baseAbbr"},"b",{"string": "subscriptAbbr"},"c",{"string": "superscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "subscriptAbbr"}, "b", {"string": "superscriptAbbr"}, "c"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "subscriptAbbr"}, "c", {"string": "superscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "mmultiscripts-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "subscript"},"b",{"string": "superscript"},"c",{"string": "superscript"},"d",{"string": "presubscript"},"e",{"string": "presubscript"},"f",{"string": "presuperscript"},"g"],
- ["a",{"string": "base"},"b",{"string": "subscript"},"c",{"string": "superscript"},"d",{"string": "superscript"},"e",{"string": "presubscript"},"f",{"string": "presubscript"},"g",{"string": "presuperscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "subscript"}, "b", {"string": "superscript"}, "c", {"string": "superscript"}, "d", {"string": "presubscript"}, "e", {"string": "presubscript"}, "f", {"string": "presuperscript"}, "g"],
+ ["a", {"string": "base"}, "b", {"string": "subscript"}, "c", {"string": "superscript"}, "d", {"string": "superscript"}, "e", {"string": "presubscript"}, "f", {"string": "presubscript"}, "g", {"string": "presuperscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "subscriptAbbr"},"b",{"string": "superscriptAbbr"},"c",{"string": "superscriptAbbr"},"d",{"string": "presubscriptAbbr"},"e",{"string": "presubscriptAbbr"},"f",{"string": "presuperscriptAbbr"},"g"],
- ["a",{"string": "baseAbbr"},"b",{"string": "subscriptAbbr"},"c",{"string": "superscriptAbbr"},"d",{"string": "superscriptAbbr"},"e",{"string": "presubscriptAbbr"},"f",{"string": "presubscriptAbbr"},"g",{"string": "presuperscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "subscriptAbbr"}, "b", {"string": "superscriptAbbr"}, "c", {"string": "superscriptAbbr"}, "d", {"string": "presubscriptAbbr"}, "e", {"string": "presubscriptAbbr"}, "f", {"string": "presuperscriptAbbr"}, "g"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "subscriptAbbr"}, "c", {"string": "superscriptAbbr"}, "d", {"string": "superscriptAbbr"}, "e", {"string": "presubscriptAbbr"}, "f", {"string": "presubscriptAbbr"}, "g", {"string": "presuperscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "munder-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "underscript"},"b"],
- ["a",{"string": "base"},"b",{"string": "underscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "underscript"}, "b"],
+ ["a", {"string": "base"}, "b", {"string": "underscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "underscriptAbbr"},"b"],
- ["a",{"string": "baseAbbr"},"b",{"string": "underscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "underscriptAbbr"}, "b"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "underscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "mover-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "overscript"},"b"],
- ["a",{"string": "base"},"b",{"string": "overscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "overscript"}, "b"],
+ ["a", {"string": "base"}, "b", {"string": "overscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "overscriptAbbr"},"b"],
- ["a",{"string": "baseAbbr"},"b",{"string": "overscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "overscriptAbbr"}, "b"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "overscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "munderover-1",
expectedUtterance: [
- [{"string": "mathmlscripted"},{"string": "base"},"a",{"string": "underscript"},"b",{"string": "overscript"},"c"],
- ["a",{"string": "base"},"b",{"string": "underscript"},"c",{"string": "overscript"},{"string": "mathmlscripted"}]
+ [{"string": "mathmlscripted"}, {"string": "base"}, "a", {"string": "underscript"}, "b", {"string": "overscript"}, "c"],
+ ["a", {"string": "base"}, "b", {"string": "underscript"}, "c", {"string": "overscript"}, {"string": "mathmlscripted"}]
],
expectedBraille: [
- [{"string": "mathmlscriptedAbbr"},{"string": "baseAbbr"},"a",{"string": "underscriptAbbr"},"b",{"string": "overscriptAbbr"},"c"],
- ["a",{"string": "baseAbbr"},"b",{"string": "underscriptAbbr"},"c",{"string": "overscriptAbbr"},{"string": "mathmlscriptedAbbr"}]
+ [{"string": "mathmlscriptedAbbr"}, {"string": "baseAbbr"}, "a", {"string": "underscriptAbbr"}, "b", {"string": "overscriptAbbr"}, "c"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "underscriptAbbr"}, "c", {"string": "overscriptAbbr"}, {"string": "mathmlscriptedAbbr"}]
]
}, {
accOrElmOrID: "mroot-1",
expectedUtterance: [
- [{"string": "mathmlroot"},{"string": "base"},"a",{"string": "root-index"},"b"],
- ["a",{"string": "base"},"b",{"string": "root-index"},{"string": "mathmlroot"}]
+ [{"string": "mathmlroot"}, {"string": "base"}, "a", {"string": "root-index"}, "b"],
+ ["a", {"string": "base"}, "b", {"string": "root-index"}, {"string": "mathmlroot"}]
],
expectedBraille: [
- [{"string": "mathmlrootAbbr"},{"string": "baseAbbr"},"a",{"string": "root-indexAbbr"},"b"],
- ["a",{"string": "baseAbbr"},"b",{"string": "root-indexAbbr"},{"string": "mathmlrootAbbr"}]
+ [{"string": "mathmlrootAbbr"}, {"string": "baseAbbr"}, "a", {"string": "root-indexAbbr"}, "b"],
+ ["a", {"string": "baseAbbr"}, "b", {"string": "root-indexAbbr"}, {"string": "mathmlrootAbbr"}]
]
}, {
accOrElmOrID: "mtable-1",
expectedUtterance: [
- [{"string": "mathmltable"},{"string": "tblColumnInfo","count": 3},{"string": "tblRowInfo","count": 2},{"string": "columnInfo","args": [1]},{"string": "rowInfo","args": [1]},"a",{"string": "columnInfo","args": [2]},{"string": "rowInfo","args": [1]},"b",{"string": "columnInfo","args": [3]},{"string": "rowInfo","args": [1]},"c",{"string": "columnInfo","args": [1]},{"string": "rowInfo","args": [2]},"d",{"string": "columnInfo","args": [2]},{"string": "rowInfo","args": [2]},"e",{"string": "columnInfo","args": [3]},{"string": "rowInfo","args": [2]},"f"],
- ["a",{"string": "columnInfo","args": [1]},{"string": "rowInfo","args": [1]},"b",{"string": "columnInfo","args": [2]},{"string": "rowInfo","args": [1]},"c",{"string": "columnInfo","args": [3]},{"string": "rowInfo","args": [1]},"d",{"string": "columnInfo","args": [1]},{"string": "rowInfo","args": [2]},"e",{"string": "columnInfo","args": [2]},{"string": "rowInfo","args": [2]},"f",{"string": "columnInfo","args": [3]},{"string": "rowInfo","args": [2]},{"string": "mathmltable"},{"string": "tblColumnInfo","count": 3},{"string": "tblRowInfo","count": 2}]
+ [{"string": "mathmltable"}, {"string": "tblColumnInfo", "count": 3}, {"string": "tblRowInfo", "count": 2}, {"string": "columnInfo", "args": [1]}, {"string": "rowInfo", "args": [1]}, "a", {"string": "columnInfo", "args": [2]}, {"string": "rowInfo", "args": [1]}, "b", {"string": "columnInfo", "args": [3]}, {"string": "rowInfo", "args": [1]}, "c", {"string": "columnInfo", "args": [1]}, {"string": "rowInfo", "args": [2]}, "d", {"string": "columnInfo", "args": [2]}, {"string": "rowInfo", "args": [2]}, "e", {"string": "columnInfo", "args": [3]}, {"string": "rowInfo", "args": [2]}, "f"],
+ ["a", {"string": "columnInfo", "args": [1]}, {"string": "rowInfo", "args": [1]}, "b", {"string": "columnInfo", "args": [2]}, {"string": "rowInfo", "args": [1]}, "c", {"string": "columnInfo", "args": [3]}, {"string": "rowInfo", "args": [1]}, "d", {"string": "columnInfo", "args": [1]}, {"string": "rowInfo", "args": [2]}, "e", {"string": "columnInfo", "args": [2]}, {"string": "rowInfo", "args": [2]}, "f", {"string": "columnInfo", "args": [3]}, {"string": "rowInfo", "args": [2]}, {"string": "mathmltable"}, {"string": "tblColumnInfo", "count": 3}, {"string": "tblRowInfo", "count": 2}]
],
expectedBraille: [
- [{"string": "mathmltableAbbr"},{"string": "tblColumnInfoAbbr","count": 3},{"string": "tblRowInfoAbbr","count": 2},{"string": "cellInfoAbbr","args": [1,1]},"a",{"string": "cellInfoAbbr","args": [2,1]},"b",{"string": "cellInfoAbbr","args": [3,1]},"c",{"string": "cellInfoAbbr","args": [1,2]},"d",{"string": "cellInfoAbbr","args": [2,2]},"e",{"string": "cellInfoAbbr","args": [3,2]},"f"],
- ["a",{"string": "cellInfoAbbr","args": [1,1]},"b",{"string": "cellInfoAbbr","args": [2,1]},"c",{"string": "cellInfoAbbr","args": [3,1]},"d",{"string": "cellInfoAbbr","args": [1,2]},"e",{"string": "cellInfoAbbr","args": [2,2]},"f",{"string": "cellInfoAbbr","args": [3,2]},{"string": "mathmltableAbbr"},{"string": "tblColumnInfoAbbr","count": 3},{"string": "tblRowInfoAbbr","count": 2}]
+ [{"string": "mathmltableAbbr"}, {"string": "tblColumnInfoAbbr", "count": 3}, {"string": "tblRowInfoAbbr", "count": 2}, {"string": "cellInfoAbbr", "args": [1, 1]}, "a", {"string": "cellInfoAbbr", "args": [2, 1]}, "b", {"string": "cellInfoAbbr", "args": [3, 1]}, "c", {"string": "cellInfoAbbr", "args": [1, 2]}, "d", {"string": "cellInfoAbbr", "args": [2, 2]}, "e", {"string": "cellInfoAbbr", "args": [3, 2]}, "f"],
+ ["a", {"string": "cellInfoAbbr", "args": [1, 1]}, "b", {"string": "cellInfoAbbr", "args": [2, 1]}, "c", {"string": "cellInfoAbbr", "args": [3, 1]}, "d", {"string": "cellInfoAbbr", "args": [1, 2]}, "e", {"string": "cellInfoAbbr", "args": [2, 2]}, "f", {"string": "cellInfoAbbr", "args": [3, 2]}, {"string": "mathmltableAbbr"}, {"string": "tblColumnInfoAbbr", "count": 3}, {"string": "tblRowInfoAbbr", "count": 2}]
]
}, {
accOrElmOrID: "menclose-1",
expectedUtterance: [
- [{"string": "mathmlenclosed"},{"string": "notation-longdiv"},"a"],
- ["a",{"string": "notation-longdiv"},{"string": "mathmlenclosed"}]
+ [{"string": "mathmlenclosed"}, {"string": "notation-longdiv"}, "a"],
+ ["a", {"string": "notation-longdiv"}, {"string": "mathmlenclosed"}]
],
expectedBraille: [
- [{"string": "mathmlenclosedAbbr"},{"string": "notation-longdivAbbr"},"a"],
- ["a",{"string": "notation-longdivAbbr"},{"string": "mathmlenclosedAbbr"}]
+ [{"string": "mathmlenclosedAbbr"}, {"string": "notation-longdivAbbr"}, "a"],
+ ["a", {"string": "notation-longdivAbbr"}, {"string": "mathmlenclosedAbbr"}]
]
}, {
accOrElmOrID: "menclose-2",
expectedUtterance: [
- [{"string": "mathmlenclosed"},{"string": "notation-circle"},"a"],
- ["a",{"string": "notation-circle"},{"string": "mathmlenclosed"}]
+ [{"string": "mathmlenclosed"}, {"string": "notation-circle"}, "a"],
+ ["a", {"string": "notation-circle"}, {"string": "mathmlenclosed"}]
],
expectedBraille: [
- [{"string": "mathmlenclosedAbbr"},{"string": "notation-circleAbbr"},"a"],
- ["a",{"string": "notation-circleAbbr"},{"string": "mathmlenclosedAbbr"}]
+ [{"string": "mathmlenclosedAbbr"}, {"string": "notation-circleAbbr"}, "a"],
+ ["a", {"string": "notation-circleAbbr"}, {"string": "mathmlenclosedAbbr"}]
]
}, {
accOrElmOrID: "menclose-3",
expectedUtterance: [
- [{"string": "mathmlenclosed"},{"string": "notation-left"},{"string": "notation-top"},{"string": "notation-bottom"},"a"],
- ["a",{"string": "notation-left"},{"string": "notation-top"},{"string": "notation-bottom"},{"string": "mathmlenclosed"}]
+ [{"string": "mathmlenclosed"}, {"string": "notation-left"}, {"string": "notation-top"}, {"string": "notation-bottom"}, "a"],
+ ["a", {"string": "notation-left"}, {"string": "notation-top"}, {"string": "notation-bottom"}, {"string": "mathmlenclosed"}]
],
expectedBraille: [
- [{"string": "mathmlenclosedAbbr"},{"string": "notation-leftAbbr"},{"string": "notation-topAbbr"},{"string": "notation-bottomAbbr"},"a"],
- ["a",{"string": "notation-leftAbbr"},{"string": "notation-topAbbr"},{"string": "notation-bottomAbbr"},{"string": "mathmlenclosedAbbr"}]
+ [{"string": "mathmlenclosedAbbr"}, {"string": "notation-leftAbbr"}, {"string": "notation-topAbbr"}, {"string": "notation-bottomAbbr"}, "a"],
+ ["a", {"string": "notation-leftAbbr"}, {"string": "notation-topAbbr"}, {"string": "notation-bottomAbbr"}, {"string": "mathmlenclosedAbbr"}]
]
}];
// Test all possible utterance order preference values.
function testOutputOrder(aOutputOrder) {
return function() {
SpecialPowers.pushPrefEnv({
"set": [[PREF_UTTERANCE_ORDER, aOutputOrder]]
--- a/accessible/tests/mochitest/layout.js
+++ b/accessible/tests/mochitest/layout.js
@@ -210,23 +210,23 @@ function getBoundsForDOMElm(aID) {
var img = elm.ownerDocument.querySelector(selector);
var areaCoords = elm.coords.split(",");
var areaX = parseInt(areaCoords[0]);
var areaY = parseInt(areaCoords[1]);
var areaWidth = parseInt(areaCoords[2]) - areaX;
var areaHeight = parseInt(areaCoords[3]) - areaY;
- var rect = img.getBoundingClientRect();
+ let rect = img.getBoundingClientRect();
x = rect.left + areaX;
y = rect.top + areaY;
width = areaWidth;
height = areaHeight;
} else {
- var rect = elm.getBoundingClientRect();
+ let rect = elm.getBoundingClientRect();
x = rect.left;
y = rect.top;
width = rect.width;
height = rect.height;
}
var elmWindow = elm.ownerGlobal;
return CSSToDevicePixels(elmWindow,
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -347,17 +347,17 @@ function evaluateXPath(aNode, aExpr, aRe
var node = aNode.ownerDocument == null ?
aNode.documentElement : aNode.ownerDocument.documentElement;
resolver = xpe.createNSResolver(node);
}
var result = xpe.evaluate(aExpr, aNode, resolver, 0, null);
var found = [];
var res;
- while (res = result.iterateNext())
+ while ((res = result.iterateNext()))
found.push(res);
return found;
}
function htmlDocResolver(aPrefix) {
var ns = {
"html": "http://www.w3.org/1999/xhtml"
--- a/accessible/tests/mochitest/pivot.js
+++ b/accessible/tests/mochitest/pivot.js
@@ -18,43 +18,43 @@ const NS_ERROR_INVALID_ARG = 0x80070057;
// //////////////////////////////////////////////////////////////////////////////
// Traversal rules
/**
* Rule object to traverse all focusable nodes and text nodes.
*/
var HeadersTraversalRule =
{
- getMatchRoles: function(aRules) {
+ getMatchRoles(aRules) {
aRules.value = [ROLE_HEADING];
return aRules.value.length;
},
preFilter: PREFILTER_INVISIBLE,
- match: function(aAccessible) {
+ match(aAccessible) {
return FILTER_MATCH;
},
QueryInterface: XPCOMUtils.generateQI([nsIAccessibleTraversalRule])
};
/**
* Traversal rule for all focusable nodes or leafs.
*/
var ObjectTraversalRule =
{
- getMatchRoles: function(aRules) {
+ getMatchRoles(aRules) {
aRules.value = [];
return 0;
},
preFilter: PREFILTER_INVISIBLE | PREFILTER_ARIA_HIDDEN | PREFILTER_TRANSPARENT,
- match: function(aAccessible) {
+ match(aAccessible) {
var rv = FILTER_IGNORE;
var role = aAccessible.role;
if (hasState(aAccessible, STATE_FOCUSABLE) &&
(role != ROLE_DOCUMENT && role != ROLE_INTERNAL_FRAME))
rv = FILTER_IGNORE_SUBTREE | FILTER_MATCH;
else if (aAccessible.childCount == 0 &&
role != ROLE_STATICTEXT && aAccessible.name.trim())
rv = FILTER_MATCH;
@@ -379,27 +379,27 @@ function setModalRootInvoker(aDocAcc, aM
function queueTraversalSequence(aQueue, aDocAcc, aRule, aModalRoot, aSequence) {
aDocAcc.virtualCursor.position = null;
// Add modal root (if any)
aQueue.push(new setModalRootInvoker(aDocAcc, aModalRoot, 0));
aQueue.push(new setVCPosInvoker(aDocAcc, "moveFirst", aRule, aSequence[0]));
- for (var i = 1; i < aSequence.length; i++) {
- var invoker =
+ for (let i = 1; i < aSequence.length; i++) {
+ let invoker =
new setVCPosInvoker(aDocAcc, "moveNext", aRule, aSequence[i]);
aQueue.push(invoker);
}
// No further more matches for given rule, expect no virtual cursor changes.
aQueue.push(new setVCPosInvoker(aDocAcc, "moveNext", aRule, false));
- for (var i = aSequence.length - 2; i >= 0; i--) {
- var invoker =
+ for (let i = aSequence.length - 2; i >= 0; i--) {
+ let invoker =
new setVCPosInvoker(aDocAcc, "movePrevious", aRule, aSequence[i]);
aQueue.push(invoker);
}
// No previous more matches for given rule, expect no virtual cursor changes.
aQueue.push(new setVCPosInvoker(aDocAcc, "movePrevious", aRule, false));
aQueue.push(new setVCPosInvoker(aDocAcc, "moveLast", aRule,
--- a/accessible/tests/mochitest/pivot/test_virtualcursor.html
+++ b/accessible/tests/mochitest/pivot/test_virtualcursor.html
@@ -55,17 +55,17 @@
"An ", "embedded", " document.", "Hide me", "Link 1", "Link 2",
"Link 3", "Hello", "World"]);
// Just a random smoke test to see if our setTextRange works.
gQueue.push(
new setVCRangeInvoker(
docAcc,
getAccessible(doc.getElementById("paragraph-2"), nsIAccessibleText),
- [2,6]));
+ [2, 6]));
gQueue.push(new removeVCPositionInvoker(
docAcc, doc.getElementById("hide-me")));
gQueue.push(new removeVCRootInvoker(
doc.getElementById("links")));
var [x, y] = getBounds(getAccessible(doc.getElementById("heading-1-1")));
--- a/accessible/tests/mochitest/pivot/test_virtualcursor_text.html
+++ b/accessible/tests/mochitest/pivot/test_virtualcursor_text.html
@@ -32,185 +32,185 @@
gQueue = new eventQueue();
gQueue.onFinish = function onFinish() {
closeBrowserWindow();
};
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("paragraph-1"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 4],
getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [4,5],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [4, 5],
getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [3,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [3, 4],
getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [5,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [5, 7],
getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,3],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 3],
getAccessible(doc.getElementById("p1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [10,14],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [10, 14],
getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,3],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 3],
getAccessible(doc.getElementById("p1-link-1"), nsIAccessibleText)));
// set user input to false, and see if it works
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [5,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [5, 7],
getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)),
false);
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("section-1"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,1],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 1],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,9],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 9],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
// set user input to false, and see if it works
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [10,14],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [10, 14],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText),
false));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [4,6],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [4, 6],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [7,12],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [7, 12],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,2],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 2],
getAccessible(doc.getElementById("s1-link-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [15,19],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [15, 19],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [20,28],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [20, 28],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,5],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 5],
getAccessible(doc.getElementById("section-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [6,10],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [6, 10],
getAccessible(doc.getElementById("section-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,5],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 5],
getAccessible(doc.getElementById("section-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [20,28],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [20, 28],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [15,19],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [15, 19],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,2],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 2],
getAccessible(doc.getElementById("s1-link-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [7,12],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [7, 12],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [4,6],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [4, 6],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [10,14],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [10, 14],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,9],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 9],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,1],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 1],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("s1-link-1"))));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [1,2],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [1, 2],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [0,1],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [0, 1],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [1,2],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [1, 2],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [0,1],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [0, 1],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [1,2],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [1, 2],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [2,9],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [2, 9],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [10,14],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [10, 14],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [3,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [3, 4],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [13,14],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [13, 14],
getAccessible(doc.getElementById("s1-link-1"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("section-2"))));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [27,28],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [27, 28],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [0,1],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [0, 1],
getAccessible(doc.getElementById("section-2"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("paragraph-2"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,12],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 12],
getAccessible(doc.getElementById("paragraph-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 7],
getAccessible(doc.getElementById("cell-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,8],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 8],
getAccessible(doc.getElementById("cell-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,3],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 3],
getAccessible(doc.getElementById("cell-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [4,11],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [4, 11],
getAccessible(doc.getElementById("cell-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,6],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 6],
getAccessible(doc.getElementById("cell-4"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [7,13],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [7, 13],
getAccessible(doc.getElementById("cell-4"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 7],
getAccessible(doc.getElementById("section-3"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("section-3"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 7],
getAccessible(doc.getElementById("section-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [7,13],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [7, 13],
getAccessible(doc.getElementById("cell-4"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,6],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 6],
getAccessible(doc.getElementById("cell-4"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [4,11],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [4, 11],
getAccessible(doc.getElementById("cell-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,3],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 3],
getAccessible(doc.getElementById("cell-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,8],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 8],
getAccessible(doc.getElementById("cell-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 7],
getAccessible(doc.getElementById("cell-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,12],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 12],
getAccessible(doc.getElementById("paragraph-2"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("paragraph-3"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 7],
getAccessible(doc.getElementById("paragraph-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,8],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 8],
getAccessible(doc.getElementById("p3-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [8,10],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [8, 10],
getAccessible(doc.getElementById("paragraph-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 4],
getAccessible(doc.getElementById("p3-link-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,5],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 5],
getAccessible(doc.getElementById("p3-link-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [14,20],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [14, 20],
getAccessible(doc.getElementById("paragraph-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,5],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 5],
getAccessible(doc.getElementById("p3-link-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 4],
getAccessible(doc.getElementById("p3-link-2"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [8,10],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [8, 10],
getAccessible(doc.getElementById("paragraph-3"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,8],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 8],
getAccessible(doc.getElementById("p3-link-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,7],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 7],
getAccessible(doc.getElementById("paragraph-3"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("s1-link-2"))));
// Start with the pivot in the middle of the paragraph
gQueue.push(new setVCPosInvoker(docAcc, "moveNext", ObjectTraversalRule, " will traverse"));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [15,19],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [15, 19],
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
- gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0,2],
+ gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, [0, 2],
getAccessible(doc.getElementById("s1-link-2"), nsIAccessibleText)));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("end-block"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 4],
getAccessible(doc.getElementById("end-block"), nsIAccessibleText)));
gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, null, false));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("start-block"))));
- gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,4],
+ gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 4],
getAccessible(doc.getElementById("start-block"), nsIAccessibleText)));
gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, null, false));
gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, null, false));
gQueue.push(new setVCPosInvoker(docAcc, null, null,
getAccessible(doc.getElementById("start-block"))));
gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, null, false));
gQueue.invoke();
--- a/accessible/tests/mochitest/relations.js
+++ b/accessible/tests/mochitest/relations.js
@@ -60,44 +60,45 @@ function testRelation(aIdentifier, aRelT
ok(false, "There are unexpected targets of " + relDescr);
return;
}
var relatedIds = (aRelatedIdentifiers instanceof Array) ?
aRelatedIdentifiers : [aRelatedIdentifiers];
var targets = [];
- for (var idx = 0; idx < relatedIds.length; idx++)
+ for (let idx = 0; idx < relatedIds.length; idx++)
targets.push(getAccessible(relatedIds[idx]));
if (targets.length != relatedIds.length)
return;
var actualTargets = relation.getTargets();
// Check if all given related accessibles are targets of obtained relation.
- for (var idx = 0; idx < targets.length; idx++) {
+ for (let idx = 0; idx < targets.length; idx++) {
var isFound = false;
- var enumerate = actualTargets.enumerate();
+ let enumerate = actualTargets.enumerate();
while (enumerate.hasMoreElements()) {
- var relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
+ let relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
if (targets[idx] == relatedAcc) {
isFound = true;
break;
}
}
ok(isFound, prettyName(relatedIds[idx]) + " is not a target of" + relDescr);
}
// Check if all obtained targets are given related accessibles.
- var enumerate = actualTargets.enumerate();
+ let enumerate = actualTargets.enumerate();
while (enumerate.hasMoreElements()) {
- var relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
- for (var idx = 0; idx < targets.length && relatedAcc != targets[idx]; idx++);
+ let relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
+ let idx;
+ for (idx = 0; idx < targets.length && relatedAcc != targets[idx]; idx++);
if (idx == targets.length)
ok(false, "There is unexpected target" + prettyName(relatedAcc) + "of" + relDescr);
}
}
/**
* Test that the given accessible relations don't exist.
@@ -123,26 +124,26 @@ function testAbsentRelation(aIdentifier,
ok(true, "No relations exist.");
return;
}
var relatedIds = (aUnrelatedIdentifiers instanceof Array) ?
aUnrelatedIdentifiers : [aUnrelatedIdentifiers];
var targets = [];
- for (var idx = 0; idx < relatedIds.length; idx++)
+ for (let idx = 0; idx < relatedIds.length; idx++)
targets.push(getAccessible(relatedIds[idx]));
if (targets.length != relatedIds.length)
return;
var actualTargets = relation.getTargets();
// Any found targets that match given accessibles should be called out.
- for (var idx = 0; idx < targets.length; idx++) {
+ for (let idx = 0; idx < targets.length; idx++) {
var notFound = true;
var enumerate = actualTargets.enumerate();
while (enumerate.hasMoreElements()) {
var relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
if (targets[idx] == relatedAcc) {
notFound = false;
break;
}
--- a/accessible/tests/mochitest/relations/test_ui_modalprompt.html
+++ b/accessible/tests/mochitest/relations/test_ui_modalprompt.html
@@ -29,17 +29,17 @@
return false;
}
}
function showAlert() {
this.eventSeq = [
{
type: EVENT_SHOW,
- match: function(aEvent) {
+ match(aEvent) {
return aEvent.accessible.role == ROLE_DIALOG;
}
}
];
this.invoke = function showAlert_invoke() {
window.setTimeout(
function() {
--- a/accessible/tests/mochitest/role.js
+++ b/accessible/tests/mochitest/role.js
@@ -162,17 +162,17 @@ function getRole(aAccOrElmOrID) {
return role;
}
/**
* Analogy of SimpleTest.is function used to check the role.
*/
function isRole(aIdentifier, aRole, aMsg) {
var role = getRole(aIdentifier);
- if (role == - 1)
+ if (role == -1)
return;
if (role == aRole) {
ok(true, aMsg);
return;
}
var got = roleToString(role);
--- a/accessible/tests/mochitest/role/a11y.ini
+++ b/accessible/tests/mochitest/role/a11y.ini
@@ -3,9 +3,10 @@ support-files =
!/accessible/tests/mochitest/*.js
!/accessible/tests/mochitest/moz.png
[test_aria.html]
[test_aria.xul]
[test_dpub_aria.html]
[test_general.html]
[test_general.xul]
+[test_graphics_aria.html]
[test_svg.html]
--- a/accessible/tests/mochitest/role/test_aria.html
+++ b/accessible/tests/mochitest/role/test_aria.html
@@ -112,17 +112,17 @@
var id = weak_landmarks[l] + "_table";
testRole(id, ROLE_TABLE);
var accessibleTable = getAccessible(id, [nsIAccessibleTable], null,
DONOTFAIL_IF_NO_INTERFACE);
ok(!!accessibleTable, "landmarked table should have nsIAccessibleTable");
if (accessibleTable)
- is(accessibleTable.getCellAt(0,0).firstChild.name, "hi", "no cell");
+ is(accessibleTable.getCellAt(0, 0).firstChild.name, "hi", "no cell");
}
// ////////////////////////////////////////////////////////////////////////
// test gEmptyRoleMap
testRole("buttontable_row", ROLE_NOTHING);
testRole("buttontable_cell", ROLE_NOTHING);
// abstract roles
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/role/test_graphics_aria.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test Graphics ARIA roles</title>
+
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+ <script type="application/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+ <script type="application/javascript"
+ src="../common.js"></script>
+ <script type="application/javascript"
+ src="../role.js"></script>
+
+ <script type="application/javascript">
+
+ function doTest() {
+ // Graphics ARIA role map.
+ testRole("graphics-document", ROLE_DOCUMENT);
+ testRole("graphics-object", ROLE_GROUPING);
+ testRole("graphics-symbol", ROLE_GRAPHIC);
+ SimpleTest.finish();
+ }
+
+ SimpleTest.waitForExplicitFinish();
+ addA11yLoadEvent(doTest);
+ </script>
+</head>
+<body>
+ <a target="_blank"
+ href="https://bugzilla.mozilla.org/show_bug.cgi?id=1432513"
+ title="implement ARIA Graphics roles">
+ Bug 1432513
+ </a>
+ <p id="display"></p>
+ <div id="content" style="display: none"></div>
+ <pre id="test"></pre>
+ <div id="graphics-document" role="graphics-document">document</div>
+ <div id="graphics-object" role="graphics-object">object</div>
+ <div id="graphics-symbol" role="graphics-symbol">symbol</div>
+</body>
+</html>
--- a/accessible/tests/mochitest/scroll/test_zoom.html
+++ b/accessible/tests/mochitest/scroll/test_zoom.html
@@ -16,37 +16,37 @@
src="../role.js"></script>
<script type="application/javascript"
src="../layout.js"></script>
<script type="application/javascript">
function testScrollToPoint() {
// scrollToPoint relative screen
var anchor = getAccessible("bottom1");
- var [x, /* y */] = getPos(anchor);
+ let [x, /* y */] = getPos(anchor);
var [docX, docY] = getPos(document);
anchor.scrollToPoint(COORDTYPE_SCREEN_RELATIVE, docX, docY);
testPos(anchor, [x, docY]);
// scrollToPoint relative window
anchor = getAccessible("bottom2");
- var [x, /* y */] = getPos(anchor);
+ [x, /* y */] = getPos(anchor);
var wnd = getRootAccessible().DOMDocument.defaultView;
var [screenX, screenY] = CSSToDevicePixels(wnd, wnd.screenX, wnd.screenY);
- var scrollToX = docX - screenX, scrollToY = docY - screenY;
+ let scrollToX = docX - screenX, scrollToY = docY - screenY;
anchor.scrollToPoint(COORDTYPE_WINDOW_RELATIVE, scrollToX, scrollToY);
testPos(anchor, [x, docY]);
// scrollToPoint relative parent
anchor = getAccessible("bottom3");
- var [x, /* y */] = getPos(anchor);
+ [x, /* y */] = getPos(anchor);
var [parentX, parentY] = getPos(anchor.parent);
- var scrollToX = parentX - docX, scrollToY = parentY - docY;
+ scrollToX = parentX - docX, scrollToY = parentY - docY;
anchor.scrollToPoint(COORDTYPE_PARENT_RELATIVE, scrollToX, scrollToY);
testPos(anchor, [x, docY]);
}
function doTest() {
testScrollToPoint();
zoomDocument(document, 2.0);
--- a/accessible/tests/mochitest/selectable.js
+++ b/accessible/tests/mochitest/selectable.js
@@ -13,32 +13,32 @@ function testSelectableSelection(aIdenti
var len = aSelectedChildren.length;
// getSelectedChildren
var selectedChildren = acc.selectedItems;
is(selectedChildren ? selectedChildren.length : 0, len,
msg + "getSelectedChildren: wrong selected children count for " +
prettyName(aIdentifier));
- for (var idx = 0; idx < len; idx++) {
- var expectedAcc = getAccessible(aSelectedChildren[idx]);
+ for (let idx = 0; idx < len; idx++) {
+ let expectedAcc = getAccessible(aSelectedChildren[idx]);
var actualAcc = selectedChildren.queryElementAt(idx, nsIAccessible);
is(actualAcc, expectedAcc,
msg + "getSelectedChildren: wrong selected child at index " + idx +
" for " + prettyName(aIdentifier) + " { actual : " +
prettyName(actualAcc) + ", expected: " + prettyName(expectedAcc) + "}");
}
// selectedItemCount
is(acc.selectedItemCount, aSelectedChildren.length,
"selectedItemCount: wrong selected children count for " + prettyName(aIdentifier));
// getSelectedItemAt
- for (var idx = 0; idx < len; idx++) {
- var expectedAcc = getAccessible(aSelectedChildren[idx]);
+ for (let idx = 0; idx < len; idx++) {
+ let expectedAcc = getAccessible(aSelectedChildren[idx]);
is(acc.getSelectedItemAt(idx), expectedAcc,
msg + "getSelectedItemAt: wrong selected child at index " + idx + " for " +
prettyName(aIdentifier));
}
// isItemSelected
testIsItemSelected(acc, acc, { value: 0 }, aSelectedChildren, msg);
}
@@ -63,16 +63,16 @@ function testIsItemSelected(aSelectAcc,
// isItemSelected
is(aSelectAcc.isItemSelected(aIndexObj.value++), isSelected,
aMsg + "isItemSelected: wrong selected child " + prettyName(child) +
" for " + prettyName(aSelectAcc));
// selected state
testStates(child, isSelected ? STATE_SELECTED : 0, 0,
- !isSelected ? STATE_SELECTED : 0 , 0);
+ !isSelected ? STATE_SELECTED : 0, 0);
continue;
}
testIsItemSelected(aSelectAcc, child, aIndexObj, aSelectedChildren);
}
}
--- a/accessible/tests/mochitest/selectable/test_select.html
+++ b/accessible/tests/mochitest/selectable/test_select.html
@@ -76,17 +76,17 @@
testSelectableSelection(select, [ "cb2_item1" ]);
select.unselectAll();
testSelectableSelection(select, [ "cb2_item1" ]);
// ////////////////////////////////////////////////////////////////////////
// select@size="4" aka single selectable listbox
- var id = "listbox";
+ id = "listbox";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
select = getAccessible(id, [nsIAccessibleSelectable]);
testSelectableSelection(select, [ ]);
// select 2nd item
select.addItemToSelection(1);
@@ -151,17 +151,17 @@
"selectAll: ");
select.unselectAll();
testSelectableSelection(select, [ ], "unselectAll: ");
// ////////////////////////////////////////////////////////////////////////
// select@size="4" multiselect with optgroups
- var id = "listbox4";
+ id = "listbox4";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
select = getAccessible(id, [nsIAccessibleSelectable]);
testSelectableSelection(select, [ ]);
select.addItemToSelection(0);
testSelectableSelection(select, [ "lb4_item1" ]);
--- a/accessible/tests/mochitest/states/test_doc.html
+++ b/accessible/tests/mochitest/states/test_doc.html
@@ -18,19 +18,19 @@
<script type="application/javascript">
function doTest() {
// Bug 566542: root accesible should expose active state when focused.
testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
// Bug 509696, 607219.
testStates(document, STATE_READONLY, 0); // role=""
- document.body.setAttribute("role","banner"); // no platform mapping
+ document.body.setAttribute("role", "banner"); // no platform mapping
testStates(document, STATE_READONLY);
- document.body.setAttribute("role","foo"); // bogus role
+ document.body.setAttribute("role", "foo"); // bogus role
testStates(document, STATE_READONLY);
document.body.removeAttribute("role");
testStates(document, STATE_READONLY);
// Bugs 454997 and 467387
testStates(document, STATE_READONLY);
testStates("document", STATE_READONLY);
testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
--- a/accessible/tests/mochitest/states/test_inputs.html
+++ b/accessible/tests/mochitest/states/test_inputs.html
@@ -26,18 +26,18 @@
testStates("input_readonly", 0, EXT_STATE_EDITABLE);
testStates("input_disabled", 0, EXT_STATE_EDITABLE);
testStates("textarea_readonly", 0, EXT_STATE_EDITABLE);
testStates("textarea_disabled", 0, EXT_STATE_EDITABLE);
// //////////////////////////////////////////////////////////////////////////
// 'required', 'readonly' and 'unavailable' states.
- var maybe_required = ["input","search","radio","checkbox","textarea"];
- var never_required = ["submit","button","reset","image"];
+ var maybe_required = ["input", "search", "radio", "checkbox", "textarea"];
+ var never_required = ["submit", "button", "reset", "image"];
var i;
for (i in maybe_required) {
testStates(maybe_required[i],
STATE_FOCUSABLE, 0,
STATE_REQUIRED | STATE_READONLY | STATE_UNAVAILABLE);
testStates(maybe_required[i] + "_required",
@@ -69,17 +69,17 @@
// //////////////////////////////////////////////////////////////////////////
// inherited from file control
var fileBrowseButton = getAccessible("file").firstChild;
testStates(fileBrowseButton, STATE_UNAVAILABLE | STATE_REQUIRED);
// No states on the label.
// //////////////////////////////////////////////////////////////////////////
// 'invalid' state
- var invalid = ["pattern","email","url"];
+ var invalid = ["pattern", "email", "url"];
for (i in invalid) {
testStates(invalid[i], STATE_INVALID);
testStates(invalid[i] + "2", 0, 0, STATE_INVALID);
}
// //////////////////////////////////////////////////////////////////////////
// not 'invalid' state
// (per spec, min/maxlength are always valid until interactively edited)
@@ -90,17 +90,17 @@
"input should be valid despite maxlength (no interactive edits)");
var validInput2 = document.createElement("input");
validInput2.minLength = "1";
validInput2.value = "";
ok(validInput2.validity.valid,
"input should be valid despite minlength (no interactive edits)");
- var valid = ["minlength","maxlength"];
+ var valid = ["minlength", "maxlength"];
for (i in valid) {
testStates(valid[i], 0, 0, STATE_INVALID);
testStates(valid[i] + "2", 0, 0, STATE_INVALID);
}
// //////////////////////////////////////////////////////////////////////////
// 'invalid' state
// (per spec, min/maxlength validity is affected by interactive edits)
--- a/accessible/tests/mochitest/table.js
+++ b/accessible/tests/mochitest/table.js
@@ -90,17 +90,17 @@ function testTableStruct(aIdentifier, aC
// special types of column headers handling
if (aColHeaderType) {
var headersObj = {
role: ROLE_LIST,
children: []
};
- for (var idx = 0; idx < colsCount; idx++) {
+ for (let idx = 0; idx < colsCount; idx++) {
var headerCellObj = {
role: ROLE_COLUMNHEADER
};
headersObj.children.push(headerCellObj);
}
if (aColHeaderType == kTreeColumnHeader) {
var columnPickerObj = {
@@ -109,43 +109,41 @@ function testTableStruct(aIdentifier, aC
headersObj.children.push(columnPickerObj);
}
tableObj.children.push(headersObj);
}
// rows and cells accessibles
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
- var rowObj = {
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ let rowObj = {
role: aRowRoles ? aRowRoles[rowIdx] : ROLE_ROW,
children: []
};
- for (var colIdx = 0; colIdx < colsCount; colIdx++) {
- var celltype = aCellsArray[rowIdx][colIdx];
+ for (let colIdx = 0; colIdx < colsCount; colIdx++) {
+ let celltype = aCellsArray[rowIdx][colIdx];
var role = ROLE_NOTHING;
switch (celltype) {
case kDataCell:
role = (aTableType == kMathTable ? ROLE_MATHML_CELL :
(isGrid ? ROLE_GRID_CELL : ROLE_CELL));
break;
case kRowHeaderCell:
role = ROLE_ROWHEADER;
break;
case kColHeaderCell:
role = ROLE_COLUMNHEADER;
break;
}
if (role != ROLE_NOTHING) {
- var cellObj = {
- role: role
- };
+ var cellObj = { role };
rowObj.children.push(cellObj);
}
}
tableObj.children.push(rowObj);
}
testAccessibleTree(aIdentifier, tableObj);
@@ -160,35 +158,36 @@ function testTableStruct(aIdentifier, aC
// rowCount and columnCount
is(table.rowCount, rowCount,
"Wrong rows count of " + prettyName(aIdentifier));
is(table.columnCount, colsCount,
"Wrong columns count of " + prettyName(aIdentifier));
// rows and columns extents
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
- for (var colIdx = 0; colIdx < colsCount; colIdx++) {
- var celltype = aCellsArray[rowIdx][colIdx];
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ for (let colIdx = 0; colIdx < colsCount; colIdx++) {
+ let celltype = aCellsArray[rowIdx][colIdx];
if (celltype & kOrigin) {
// table getRowExtentAt
var rowExtent = table.getRowExtentAt(rowIdx, colIdx);
- for (var idx = rowIdx + 1;
+ let idx;
+ for (idx = rowIdx + 1;
idx < rowCount && (aCellsArray[idx][colIdx] & kRowSpanned);
idx++);
var expectedRowExtent = idx - rowIdx;
is(rowExtent, expectedRowExtent,
"getRowExtentAt: Wrong number of spanned rows at (" + rowIdx + ", " +
colIdx + ") for " + prettyName(aIdentifier));
// table getColumnExtentAt
var colExtent = table.getColumnExtentAt(rowIdx, colIdx);
- for (var idx = colIdx + 1;
+ for (idx = colIdx + 1;
idx < colsCount && (aCellsArray[rowIdx][idx] & kColSpanned);
idx++);
var expectedColExtent = idx - colIdx;
is(colExtent, expectedColExtent,
"getColumnExtentAt: Wrong number of spanned columns at (" + rowIdx +
", " + colIdx + ") for " + prettyName(aIdentifier));
@@ -234,17 +233,17 @@ function testTableIndexes(aIdentifier, a
try {
cellAcc = null;
cellAcc = tableAcc.getCellAt(rowIdx, colIdx);
} catch (e) { }
ok(idx != -1 && cellAcc || idx == -1 && !cellAcc,
id + ": Can't get cell accessible at row = " + rowIdx + ", column = " + colIdx);
- if (idx != - 1) {
+ if (idx != -1) {
// getRowIndexAt
var origRowIdx = rowIdx;
while (origRowIdx > 0 &&
aIdxes[rowIdx][colIdx] == aIdxes[origRowIdx - 1][colIdx])
origRowIdx--;
try {
@@ -369,19 +368,19 @@ function testTableSelection(aIdentifier,
var rowCount = aCellsArray.length;
var colsCount = aCellsArray[0].length;
// Columns selection tests.
var selCols = [];
// isColumnSelected test
- for (var colIdx = 0; colIdx < colsCount; colIdx++) {
+ for (let colIdx = 0; colIdx < colsCount; colIdx++) {
var isColSelected = true;
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
if (aCellsArray[rowIdx][colIdx] == false ||
aCellsArray[rowIdx][colIdx] == undefined) {
isColSelected = false;
break;
}
}
is(acc.isColumnSelected(colIdx), isColSelected,
@@ -400,28 +399,28 @@ function testTableSelection(aIdentifier,
var actualSelColsCountObj = { value: null };
var actualSelCols = acc.getSelectedColumnIndices(actualSelColsCountObj);
var actualSelColsCount = actualSelColsCountObj.value;
is(actualSelColsCount, selCols.length,
msg + "Wrong count of selected columns for " + prettyName(aIdentifier) +
"from getSelectedColumns.");
- for (var i = 0; i < actualSelColsCount; i++) {
+ for (let i = 0; i < actualSelColsCount; i++) {
is(actualSelCols[i], selCols[i],
msg + "Column at index " + selCols[i] + " should be selected.");
}
// Rows selection tests.
var selRows = [];
// isRowSelected test
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
var isRowSelected = true;
- for (var colIdx = 0; colIdx < colsCount; colIdx++) {
+ for (let colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] == false ||
aCellsArray[rowIdx][colIdx] == undefined) {
isRowSelected = false;
break;
}
}
is(acc.isRowSelected(rowIdx), isRowSelected,
@@ -440,27 +439,27 @@ function testTableSelection(aIdentifier,
var actualSelrowCountObj = { value: null };
var actualSelRows = acc.getSelectedRowIndices(actualSelrowCountObj);
var actualSelrowCount = actualSelrowCountObj.value;
is(actualSelrowCount, selRows.length,
msg + "Wrong count of selected rows for " + prettyName(aIdentifier) +
"from getSelectedRows.");
- for (var i = 0; i < actualSelrowCount; i++) {
+ for (let i = 0; i < actualSelrowCount; i++) {
is(actualSelRows[i], selRows[i],
msg + "Row at index " + selRows[i] + " should be selected.");
}
// Cells selection tests.
var selCells = [];
// isCellSelected test
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
- for (var colIdx = 0; colIdx < colsCount; colIdx++) {
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ for (let colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] & kSpanned)
continue;
var isSelected = aCellsArray[rowIdx][colIdx] == true;
is(acc.isCellSelected(rowIdx, colIdx), isSelected,
msg + "Wrong selection state of cell at " + rowIdx + " row and " +
colIdx + " column for " + prettyName(aIdentifier));
@@ -477,43 +476,43 @@ function testTableSelection(aIdentifier,
var actualSelCellsCountObj = { value: null };
var actualSelCells = acc.getSelectedCellIndices(actualSelCellsCountObj);
var actualSelCellsCount = actualSelCellsCountObj.value;
is(actualSelCellsCount, selCells.length,
msg + "Wrong count of selected cells for " + prettyName(aIdentifier) +
"from getSelectedCells.");
- for (var i = 0; i < actualSelCellsCount; i++) {
+ for (let i = 0; i < actualSelCellsCount; i++) {
is(actualSelCells[i], selCells[i],
msg + "getSelectedCellIndices: Cell at index " + selCells[i] +
" should be selected.");
}
// selectedCells and isSelected tests
var actualSelCellsArray = acc.selectedCells;
- for (var i = 0; i < actualSelCellsCount; i++) {
+ for (let i = 0; i < actualSelCellsCount; i++) {
var actualSelCellAccessible =
actualSelCellsArray.queryElementAt(i, nsIAccessibleTableCell);
- var colIdx = acc.getColumnIndexAt(selCells[i]);
- var rowIdx = acc.getRowIndexAt(selCells[i]);
+ let colIdx = acc.getColumnIndexAt(selCells[i]);
+ let rowIdx = acc.getRowIndexAt(selCells[i]);
var expectedSelCellAccessible = acc.getCellAt(rowIdx, colIdx);
ok(actualSelCellAccessible, expectedSelCellAccessible,
msg + "getSelectedCells: Cell at index " + selCells[i] +
" should be selected.");
ok(actualSelCellAccessible.isSelected(),
"isSelected: Cell at index " + selCells[i] + " should be selected.");
}
// selected states tests
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
- for (var colIdx = 0; colIdx < colsCount; colIdx++) {
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ for (let colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] & kSpanned)
continue;
var cell = acc.getCellAt(rowIdx, colIdx);
var isSel = aCellsArray[rowIdx][colIdx];
if (isSel == undefined)
testStates(cell, 0, 0, STATE_SELECTABLE | STATE_SELECTED);
else if (isSel == true)
@@ -695,17 +694,17 @@ function testHeaderCells(aHeaderInfoMap)
var actualRowHeaderCells = dataCell.rowHeaderCells;
var actualRowHeaderCellsCount = actualRowHeaderCells.length;
is(actualRowHeaderCellsCount, rowHeaderCellsCount,
"Wrong number of row header cells for the cell " +
prettyName(dataCellIdentifier));
if (actualRowHeaderCellsCount == rowHeaderCellsCount) {
- for (var idx = 0; idx < rowHeaderCellsCount; idx++) {
+ for (let idx = 0; idx < rowHeaderCellsCount; idx++) {
var rowHeaderCell = getAccessible(rowHeaderCells[idx]);
var actualRowHeaderCell =
actualRowHeaderCells.queryElementAt(idx, nsIAccessible);
isObject(actualRowHeaderCell, rowHeaderCell,
"Wrong row header cell at index " + idx + " for the cell " +
dataCellIdentifier);
}
}
@@ -716,17 +715,17 @@ function testHeaderCells(aHeaderInfoMap)
var actualColHeaderCells = dataCell.columnHeaderCells;
var actualColHeaderCellsCount = actualColHeaderCells.length;
is(actualColHeaderCellsCount, colHeaderCellsCount,
"Wrong number of column header cells for the cell " +
prettyName(dataCellIdentifier));
if (actualColHeaderCellsCount == colHeaderCellsCount) {
- for (var idx = 0; idx < colHeaderCellsCount; idx++) {
+ for (let idx = 0; idx < colHeaderCellsCount; idx++) {
var colHeaderCell = getAccessible(colHeaderCells[idx]);
var actualColHeaderCell =
actualColHeaderCells.queryElementAt(idx, nsIAccessible);
isObject(actualColHeaderCell, colHeaderCell,
"Wrong column header cell at index " + idx + " for the cell " +
dataCellIdentifier);
}
}
@@ -740,27 +739,27 @@ function testHeaderCells(aHeaderInfoMap)
* Return row and column of orig cell for the given spanned cell.
*/
function getOrigRowAndColumn(aCellsArray, aRowIdx, aColIdx) {
var cellState = aCellsArray[aRowIdx][aColIdx];
var origRowIdx = aRowIdx, origColIdx = aColIdx;
if (cellState & kRowSpanned) {
for (var prevRowIdx = aRowIdx - 1; prevRowIdx >= 0; prevRowIdx--) {
- var prevCellState = aCellsArray[prevRowIdx][aColIdx];
+ let prevCellState = aCellsArray[prevRowIdx][aColIdx];
if (!(prevCellState & kRowSpanned)) {
origRowIdx = prevRowIdx;
break;
}
}
}
if (cellState & kColSpanned) {
for (var prevColIdx = aColIdx - 1; prevColIdx >= 0; prevColIdx--) {
- var prevCellState = aCellsArray[aRowIdx][prevColIdx];
+ let prevCellState = aCellsArray[aRowIdx][prevColIdx];
if (!(prevCellState & kColSpanned)) {
origColIdx = prevColIdx;
break;
}
}
}
return [origRowIdx, origColIdx];
--- a/accessible/tests/mochitest/table/test_indexes_table.html
+++ b/accessible/tests/mochitest/table/test_indexes_table.html
@@ -37,17 +37,17 @@ https://bugzilla.mozilla.org/show_bug.cg
[6, 7, 7],
[6, 8, 9]
];
testTableIndexes("tableborder", idxes);
// ////////////////////////////////////////////////////////////////////////
// table
- var idxes = [
+ idxes = [
[ 0, 1, 2, 2, 3, 4, 5, 6],
[ 7, 8, 9, 10, 11, 12, 13, 6],
[14, 15, 15, 16, 17, 18, 19, 6],
[20, 15, 15, 21, 22, 18, 23, 6]
];
testTableIndexes("table2", idxes);
--- a/accessible/tests/mochitest/table/test_mtable.html
+++ b/accessible/tests/mochitest/table/test_mtable.html
@@ -49,19 +49,19 @@
ROLE_MATHML_TABLE_ROW
];
testTableStruct("complex", cellsArray, kNoColumnHeader,
"", "", kMathTable, rowsArray);
// 'Simple' table with mlabeledtr
// At the moment we do not implement mlabeledtr but just hide the label
// with display: none. Thus we just test the role for now. See bug 689641.
- var idxes = [[0]];
+ idxes = [[0]];
testTableIndexes("simple_label", idxes);
- var cellsArray = [[kDataCell]];
+ cellsArray = [[kDataCell]];
rowsArray = [ROLE_MATHML_LABELED_ROW];
testTableStruct("simple_label", cellsArray, kNoColumnHeader,
"", "", kMathTable, rowsArray);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/table/test_sels_table.html
+++ b/accessible/tests/mochitest/table/test_sels_table.html
@@ -30,29 +30,29 @@
[false, false, false, false, false, false, false, kRowSpanned],
[false, false, kColSpanned, false, false, false, false, kRowSpanned],
[false, kRowSpanned, kSpanned, false, false, kRowSpanned, false, kRowSpanned]
];
testTableSelection("table", cellsArray);
var rowCount = 4;
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++)
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++)
testSelectTableRow("table", rowIdx, cellsArray);
- for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+ for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
testSelectTableRow("table", rowIdx, cellsArray);
testUnselectTableRow("table", rowIdx, cellsArray);
}
var columsCount = 8;
- for (var colIdx = 0; colIdx < columsCount; colIdx++)
+ for (let colIdx = 0; colIdx < columsCount; colIdx++)
testSelectTableColumn("table", colIdx, cellsArray);
- for (var colIdx = 0; colIdx < columsCount; colIdx++) {
+ for (let colIdx = 0; colIdx < columsCount; colIdx++) {
testSelectTableColumn("table", colIdx, cellsArray);
testUnselectTableColumn("table", colIdx, cellsArray);
}
var accTable = getAccessible("table", [nsIAccessibleTable]);
ok(!accTable.isProbablyForLayout(), "table is not for layout");
// ////////////////////////////////////////////////////////////////////////
--- a/accessible/tests/mochitest/table/test_table_2.html
+++ b/accessible/tests/mochitest/table/test_table_2.html
@@ -19,38 +19,38 @@ function doTest() {
var accTable3 = getAccessible("table3", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
if (!accTable3)
tableInterfaceExposed = false;
ok(tableInterfaceExposed, "table interface is not exposed");
if (tableInterfaceExposed) {
testRole(accTable3, ROLE_ALERT);
- is(accTable3.getCellAt(0,0).firstChild.name, "cell0", "wrong cell");
- is(accTable3.getCellAt(0,1).firstChild.name, "cell1", "wrong cell");
+ is(accTable3.getCellAt(0, 0).firstChild.name, "cell0", "wrong cell");
+ is(accTable3.getCellAt(0, 1).firstChild.name, "cell1", "wrong cell");
}
// Test table with role=log and aria property in tr. We create accessible for
// tr in this case.
tableInterfaceExposed = true;
var accTable4 = getAccessible("table4", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
if (!accTable4)
tableInterfaceExposed = false;
ok(tableInterfaceExposed, "table interface is not exposed");
if (tableInterfaceExposed) {
accNotCreated = (!isAccessible("tr"));
ok(!accNotCreated, "missed tr accessible");
testRole(accTable4, ROLE_TABLE);
- is(accTable4.getCellAt(0,0).firstChild.name, "cell0", "wrong cell");
- is(accTable4.getCellAt(0,1).firstChild.name, "cell1", "wrong cell");
- is(accTable4.getCellAt(1,0).firstChild.name, "cell2", "wrong cell");
- is(accTable4.getCellAt(1,1).firstChild.name, "cell3", "wrong cell");
+ is(accTable4.getCellAt(0, 0).firstChild.name, "cell0", "wrong cell");
+ is(accTable4.getCellAt(0, 1).firstChild.name, "cell1", "wrong cell");
+ is(accTable4.getCellAt(1, 0).firstChild.name, "cell2", "wrong cell");
+ is(accTable4.getCellAt(1, 1).firstChild.name, "cell3", "wrong cell");
}
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
--- a/accessible/tests/mochitest/test_aria_token_attrs.html
+++ b/accessible/tests/mochitest/test_aria_token_attrs.html
@@ -32,17 +32,17 @@ https://bugzilla.mozilla.org/show_bug.cg
testStates("button_pressed_empty", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
testStates("button_pressed_undefined", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
testStates("button_pressed_absent", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
// test (checkbox) checkable and checked states
testStates("checkbox_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
testStates("checkbox_checked_mixed", (STATE_CHECKABLE | STATE_MIXED), 0, STATE_CHECKED);
testStates("checkbox_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
- testStates("checkbox_checked_empty", STATE_CHECKABLE , 0, STATE_CHECKED);
+ testStates("checkbox_checked_empty", STATE_CHECKABLE, 0, STATE_CHECKED);
testStates("checkbox_checked_undefined", STATE_CHECKABLE, 0, STATE_CHECKED);
testStates("checkbox_checked_absent", STATE_CHECKABLE, 0, STATE_CHECKED);
// test native checkbox checked state and aria-checked state (if conflict, native wins)
testStates("native_checkbox_nativechecked_ariatrue", (STATE_CHECKABLE | STATE_CHECKED));
testStates("native_checkbox_nativechecked_ariafalse", (STATE_CHECKABLE | STATE_CHECKED));
testStates("native_checkbox_nativechecked_ariaempty", (STATE_CHECKABLE | STATE_CHECKED));
testStates("native_checkbox_nativechecked_ariaundefined", (STATE_CHECKABLE | STATE_CHECKED));
@@ -87,17 +87,17 @@ https://bugzilla.mozilla.org/show_bug.cg
testStates("listbox_multiselectable_false", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
testStates("listbox_multiselectable_empty", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
testStates("listbox_multiselectable_undefined", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
testStates("listbox_multiselectable_absent", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
// test (option) checkable and checked states
testStates("option_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
testStates("option_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
- testStates("option_checked_empty", 0 , 0, STATE_CHECKABLE | STATE_CHECKED);
+ testStates("option_checked_empty", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
testStates("option_checked_undefined", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
testStates("option_checked_absent", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
// test (menuitem) checkable and checked states, which are unsupported on this role
testStates("menuitem_checked_true", 0, 0, (STATE_CHECKABLE | STATE_CHECKED));
testStates("menuitem_checked_mixed", 0, 0, (STATE_CHECKABLE | STATE_CHECKED | STATE_MIXED));
testStates("menuitem_checked_false", 0, 0, (STATE_CHECKABLE | STATE_CHECKED));
testStates("menuitem_checked_empty", 0, 0, (STATE_CHECKABLE | STATE_CHECKED));
--- a/accessible/tests/mochitest/test_nsIAccessibleImage.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleImage.html
@@ -110,17 +110,17 @@ https://bugzilla.mozilla.org/show_bug.cg
testThis("nonLinkedImage", "moz.png", 89, 38);
// Test linked image
var actionNamesArray = ["jump"];
testThis("linkedImage", "moz.png", 89, 38, 1,
actionNamesArray);
// Image with long desc
- var actionNamesArray = ["showlongdesc"];
+ actionNamesArray = ["showlongdesc"];
testThis("longdesc", "moz.png", 89, 38, 1,
actionNamesArray);
// Image with invalid url in long desc
testThis("invalidLongdesc", "moz.png", 89, 38, 0);
// Image with click and long desc
actionNamesArray = null;
--- a/accessible/tests/mochitest/text.js
+++ b/accessible/tests/mochitest/text.js
@@ -477,40 +477,40 @@ function testTextRange(aRange, aRangeDes
}
// //////////////////////////////////////////////////////////////////////////////
// Private
function testTextSuperHelper(aFuncName, aArgs) {
// List of tests.
if (aArgs[2] instanceof Array) {
- var ids = (aArgs[0] instanceof Array) ? aArgs[0] : [ aArgs[0] ];
- var boundaryType = aArgs[1];
- var list = aArgs[2];
- for (var i = 0; i < list.length; i++) {
- var offset1 = list[i][0], offset2 = list[i][1];
- var text = list[i][2], startOffset = list[i][3], endOffset = list[i][4];
- var failureList = list[i][5];
- for (var offset = offset1; offset <= offset2; offset++) {
- for (var idIdx = 0; idIdx < ids.length; idIdx++) {
- var id = ids[idIdx];
+ let ids = (aArgs[0] instanceof Array) ? aArgs[0] : [ aArgs[0] ];
+ let boundaryType = aArgs[1];
+ let list = aArgs[2];
+ for (let i = 0; i < list.length; i++) {
+ let offset1 = list[i][0], offset2 = list[i][1];
+ let text = list[i][2], startOffset = list[i][3], endOffset = list[i][4];
+ let failureList = list[i][5];
+ for (let offset = offset1; offset <= offset2; offset++) {
+ for (let idIdx = 0; idIdx < ids.length; idIdx++) {
+ let id = ids[idIdx];
- var flagOk1 = kOk, flagOk2 = kOk, flagOk3 = kOk;
+ let flagOk1 = kOk, flagOk2 = kOk, flagOk3 = kOk;
if (failureList) {
- for (var fIdx = 0; fIdx < failureList.length; fIdx++) {
+ for (let fIdx = 0; fIdx < failureList.length; fIdx++) {
if (offset == failureList[fIdx][0] && id == failureList[fIdx][1]) {
flagOk1 = failureList[fIdx][2];
flagOk2 = failureList[fIdx][3];
flagOk3 = failureList[fIdx][4];
break;
}
}
}
- var acc = getAccessible(id, nsIAccessibleText);
+ let acc = getAccessible(id, nsIAccessibleText);
testTextHelper(id, offset, boundaryType,
text, startOffset, endOffset,
flagOk1, flagOk2, flagOk3,
acc[aFuncName], aFuncName + " ");
}
}
}
return;
@@ -518,35 +518,35 @@ function testTextSuperHelper(aFuncName,
// Test at single offset. List of IDs.
var offset = aArgs[0];
var boundaryType = aArgs[1];
var text = aArgs[2];
var startOffset = aArgs[3];
var endOffset = aArgs[4];
if (aArgs[5] instanceof Array) {
- var ids = aArgs[5];
- for (var i = 0; i < ids.length; i++) {
- var acc = getAccessible(ids[i], nsIAccessibleText);
+ let ids = aArgs[5];
+ for (let i = 0; i < ids.length; i++) {
+ let acc = getAccessible(ids[i], nsIAccessibleText);
testTextHelper(ids[i], offset, boundaryType,
text, startOffset, endOffset,
kOk, kOk, kOk,
acc[aFuncName], aFuncName + " ");
}
return;
}
// Each ID is tested separately.
- for (var i = 5; i < aArgs.length; i = i + 4) {
- var ID = aArgs[i];
- var acc = getAccessible(ID, nsIAccessibleText);
- var toDoFlag1 = aArgs[i + 1];
- var toDoFlag2 = aArgs[i + 2];
- var toDoFlag3 = aArgs[i + 3];
+ for (let i = 5; i < aArgs.length; i = i + 4) {
+ let ID = aArgs[i];
+ let acc = getAccessible(ID, nsIAccessibleText);
+ let toDoFlag1 = aArgs[i + 1];
+ let toDoFlag2 = aArgs[i + 2];
+ let toDoFlag3 = aArgs[i + 3];
testTextHelper(ID, offset, boundaryType,
text, startOffset, endOffset,
toDoFlag1, toDoFlag2, toDoFlag3,
acc[aFuncName], aFuncName + " ");
}
}
--- a/accessible/tests/mochitest/text/test_atcaretoffset.html
+++ b/accessible/tests/mochitest/text/test_atcaretoffset.html
@@ -63,26 +63,26 @@
this.mAtWrappedLineEnd = true;
else
this.mLine = nextLine;
}
return true;
};
- Object.defineProperty(this, "offset", { get: function() { return this.mOffset; }
+ Object.defineProperty(this, "offset", { get() { return this.mOffset; }
});
- Object.defineProperty(this, "offsetDescr", { get: function() {
+ Object.defineProperty(this, "offsetDescr", { get() {
return this.mOffset + " offset (" + this.mLine.number + " line, " +
(this.mOffset - this.mLine.start) + " offset on the line)";
}
});
- Object.defineProperty(this, "tests", { get: function() {
+ Object.defineProperty(this, "tests", { get() {
// Line boundary tests.
var cLine = this.mLine;
var pLine = cLine.prevLine;
var ppLine = pLine.prevLine;
var nLine = cLine.nextLine;
var nnLine = nLine.nextLine;
var lineTests = [
@@ -157,17 +157,17 @@
this.mAtWrappedLineEnd ? this.offset : nextOffset,
this.mAtWrappedLineEnd ? nextOffset : nextAfterNextOffset ]
];
return lineTests.concat(wordTests.concat(charTests));
}
});
- Object.defineProperty(this, "failures", { get: function() {
+ Object.defineProperty(this, "failures", { get() {
if (this.mOffset == this.mLine.start)
return this.mLine.lineStartFailures;
if (this.mOffset == this.mLine.end)
return this.mLine.lineEndFailures;
return [];
}
});
@@ -176,133 +176,133 @@
this.mAtWrappedLineEnd = false;
this.mWord = this.mLine.firstWord;
}
/**
* A line object. Allows to navigate by lines and by words.
*/
function line(aWholeText, aLines, aIndex) {
- Object.defineProperty(this, "prevLine", { get: function() {
+ Object.defineProperty(this, "prevLine", { get() {
return new line(aWholeText, aLines, aIndex - 1);
}
});
- Object.defineProperty(this, "nextLine", { get: function() {
+ Object.defineProperty(this, "nextLine", { get() {
return new line(aWholeText, aLines, aIndex + 1);
}
});
- Object.defineProperty(this, "start", { get: function() {
+ Object.defineProperty(this, "start", { get() {
if (aIndex < 0)
return 0;
if (aIndex >= aLines.length)
return aWholeText.length;
return aLines[aIndex][2];
}
});
- Object.defineProperty(this, "end", { get: function() {
+ Object.defineProperty(this, "end", { get() {
if (aIndex < 0)
return 0;
if (aIndex >= aLines.length)
return aWholeText.length;
return aLines[aIndex][3];
}
});
- Object.defineProperty(this, "number", { get: function() { return aIndex; }
+ Object.defineProperty(this, "number", { get() { return aIndex; }
});
- Object.defineProperty(this, "wholeText", { get: function() { return aWholeText; }
+ Object.defineProperty(this, "wholeText", { get() { return aWholeText; }
});
this.isFakeLine = function line_isFakeLine() {
return aIndex < 0 || aIndex >= aLines.length;
};
- Object.defineProperty(this, "lastWord", { get: function() {
+ Object.defineProperty(this, "lastWord", { get() {
if (aIndex < 0)
return new word(this, [], -1);
if (aIndex >= aLines.length)
return new word(this, [], 0);
var words = aLines[aIndex][4].words;
return new word(this, words, words.length - 2);
}
});
- Object.defineProperty(this, "firstWord", { get: function() {
+ Object.defineProperty(this, "firstWord", { get() {
if (aIndex < 0)
return new word(this, [], -1);
if (aIndex >= aLines.length)
return new word(this, [], 0);
var words = aLines[aIndex][4].words;
return new word(this, words, 0);
}
});
this.isLastWord = function line_isLastWord(aWord) {
var lastWord = this.lastWord;
return lastWord.start == aWord.start && lastWord.end == aWord.end;
};
- Object.defineProperty(this, "lineStartFailures", { get: function() {
+ Object.defineProperty(this, "lineStartFailures", { get() {
if (aIndex < 0 || aIndex >= aLines.length)
return [];
return aLines[aIndex][4].lsf || [];
}
});
- Object.defineProperty(this, "lineEndFailures", { get: function() {
+ Object.defineProperty(this, "lineEndFailures", { get() {
if (aIndex < 0 || aIndex >= aLines.length)
return [];
return aLines[aIndex][4].lef || [];
}
});
}
/**
* A word object. Allows to navigate by words.
*/
function word(aLine, aWords, aIndex) {
- Object.defineProperty(this, "prevWord", { get: function() {
+ Object.defineProperty(this, "prevWord", { get() {
if (aIndex >= 2)
return new word(aLine, aWords, aIndex - 2);
var prevLineLastWord = aLine.prevLine.lastWord;
if (this.start == prevLineLastWord.start && !this.isFakeStartWord())
return prevLineLastWord.prevWord;
return prevLineLastWord;
}
});
- Object.defineProperty(this, "nextWord", { get: function() {
+ Object.defineProperty(this, "nextWord", { get() {
if (aIndex + 2 < aWords.length)
return new word(aLine, aWords, aIndex + 2);
var nextLineFirstWord = aLine.nextLine.firstWord;
if (this.end == nextLineFirstWord.end && !this.isFakeEndWord())
return nextLineFirstWord.nextWord;
return nextLineFirstWord;
}
});
- Object.defineProperty(this, "line", { get: function() { return aLine; } });
+ Object.defineProperty(this, "line", { get() { return aLine; } });
- Object.defineProperty(this, "start", { get: function() {
+ Object.defineProperty(this, "start", { get() {
if (this.isFakeStartWord())
return 0;
if (this.isFakeEndWord())
return aLine.end;
return aWords[aIndex];
}
});
- Object.defineProperty(this, "end", { get: function() {
+ Object.defineProperty(this, "end", { get() {
if (this.isFakeStartWord())
return 0;
return this.isFakeEndWord() ? aLine.end : aWords[aIndex + 1];
}
});
this.toString = function word_toString() {
--- a/accessible/tests/mochitest/text/test_gettext.html
+++ b/accessible/tests/mochitest/text/test_gettext.html
@@ -52,17 +52,17 @@
//
// __o__n__e__w__o__r__d__\n
// 0 1 2 3 4 5 6 7
// __\n
// 8
// __t__w__o__ __w__o__r__d__s__\n
// 9 10 11 12 13 14 15 16 17 18
- var IDs = ["d3", "dbr3", "e3", "ebr3", "t3"];
+ IDs = ["d3", "dbr3", "e3", "ebr3", "t3"];
testCharacterCount(IDs, 19);
testText(IDs, 0, 19, "oneword\n\ntwo words\n");
testText(IDs, 0, -1, "oneword\n\ntwo words\n");
SimpleTest.finish();
}
--- a/accessible/tests/mochitest/text/test_wordboundary.html
+++ b/accessible/tests/mochitest/text/test_wordboundary.html
@@ -31,17 +31,17 @@
testTextAfterOffset(ids, BOUNDARY_WORD_START,
[ [ 0, 5, "", 5, 5 ] ]);
testTextAfterOffset(ids, BOUNDARY_WORD_END,
[ [ 0, 5, "", 5, 5 ] ]);
// "hello "
// __h__e__l__l__o__ __
// 0 1 2 3 4 5 6
- var ids = [ "i2", "d2", "e2", "t2" ];
+ ids = [ "i2", "d2", "e2", "t2" ];
testTextBeforeOffset(ids, BOUNDARY_WORD_START,
[ [ 0, 6, "", 0, 0 ] ]);
testTextBeforeOffset(ids, BOUNDARY_WORD_END,
[ [ 0, 5, "", 0, 0 ],
[ 6, 6, "hello", 0, 5 ]
]);
testTextAtOffset(ids, BOUNDARY_WORD_START,
--- a/accessible/tests/mochitest/textattrs/test_general.html
+++ b/accessible/tests/mochitest/textattrs/test_general.html
@@ -532,32 +532,32 @@
testTextAttrs(ID, 39, attrs, defAttrs, 39, 44);
// ////////////////////////////////////////////////////////////////////////
// area18, "auto-generation text" tests
ID = "area18";
defAttrs = buildDefaultTextAttrs(ID, "12pt");
testDefaultTextAttrs(ID, defAttrs);
- var attrs = {
+ attrs = {
"auto-generated": "true"
};
testTextAttrs(ID, 0, attrs, defAttrs, 0, 3);
testTextAttrs(ID, 3, { }, defAttrs, 3, 7);
testTextAttrs(ID, 7, attrs, defAttrs, 7, 8);
// ////////////////////////////////////////////////////////////////////////
// area19, "HTML5 mark tag" test
// text enclosed in mark tag will have a different background color
ID = "area19";
defAttrs = buildDefaultTextAttrs(ID, "12pt");
attrs = {};
testTextAttrs(ID, 0, attrs, defAttrs, 0, 10);
-
+
tempElem = getNode(ID).firstChild.nextSibling;
gComputedStyle = document.defaultView.getComputedStyle(tempElem);
attrs = { "background-color": gComputedStyle.backgroundColor };
testTextAttrs(ID, 11, attrs, defAttrs, 10, 17);
attrs = {};
testTextAttrs(ID, 18, attrs, defAttrs, 17, 28);
@@ -639,19 +639,19 @@
</p>
<!-- Green!*!RedNormal-->
<p id="area5">
<span style="color: green">Green</span>
<img src="../moz.png" alt="image"/>
<span style="color: red">Red</span>Normal
</p>
<p id="area6">
- This <sup>sentence</sup> has the word
- <span style="vertical-align:super;">sentence</span> in
- <sub>superscript</sub> and
+ This <sup>sentence</sup> has the word
+ <span style="vertical-align:super;">sentence</span> in
+ <sub>superscript</sub> and
<span style="vertical-align:sub;">subscript</span> and
<span style="vertical-align:20%;">superscript 20%</span> and
<span style="vertical-align:-20%;">subscript 20%</span> and
<span style="vertical-align:20px;">superscript 20px</span> and
<span style="vertical-align:-20px;">subscript 20px</span>
</p>
<p lang="en" id="area7">
--- a/accessible/tests/mochitest/textcaret/test_general.html
+++ b/accessible/tests/mochitest/textcaret/test_general.html
@@ -10,23 +10,22 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
+ /* import-globals-from ../common.js */
/**
* Turn on/off the caret browsing mode.
*/
function turnCaretBrowsing(aIsOn) {
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch);
- prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
+ Services.prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
}
/**
* Test caret offset for the given accessible.
*/
function testCaretOffset(aID, aCaretOffset) {
var acc = getAccessible(aID, [nsIAccessibleText]);
is(acc.caretOffset, aCaretOffset,
@@ -98,17 +97,17 @@
[ getNode("p2", p2Doc), 1 ],
[ p2Doc, 0 ]
]
},
{ // after 'b' (inside anchor)
DOMPoint: [ getNode("p2_a", p2Doc).firstChild, 1 ],
point: [ getNode("p2_a", p2Doc), 1 ],
pointList: [
- [ getNode("p2", p2Doc), 1 ] ,
+ [ getNode("p2", p2Doc), 1 ],
[ p2Doc, 0 ]
]
},
{ // before 'c' (after anchor)
DOMPoint: [ getNode("p2", p2Doc).lastChild, 0 ],
point: [ getNode("p2", p2Doc), 2 ],
pointList: [ [ p2Doc, 0 ] ]
},
--- a/accessible/tests/mochitest/textrange/test_selection.html
+++ b/accessible/tests/mochitest/textrange/test_selection.html
@@ -31,69 +31,69 @@
testTextRange(a11yrange, "selection range #1", document, 3, document, 4);
ok(a11yrange.crop(getAccessible(a)), "Range failed to crop #1.");
testTextRange(a11yrange, "cropped range #1", a, 0, a, 5);
// the range is contained by the accessible
range.selectNode(a);
- var a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
- var a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
+ a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
+ a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(a11yrange, "selection range #2", p, 5, p, 6);
ok(a11yrange.crop(getAccessible(p)), "Range failed to crop #2.");
testTextRange(a11yrange, "cropped range #2", p, 5, p, 6);
// the range starts before the accessible and ends inside it
range.setStart(p, 0);
range.setEndAfter(a.firstChild, 4);
- var a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
- var a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
+ a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
+ a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(a11yrange, "selection range #3", p, 0, a, 4);
ok(a11yrange.crop(getAccessible(a)), "Range failed to crop #3.");
testTextRange(a11yrange, "cropped range #3", a, 0, a, 4);
// the range starts inside the accessible and ends after it
range.setStart(a.firstChild, 1);
range.setEndAfter(p);
- var a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
- var a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
+ a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
+ a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(a11yrange, "selection range #4", a, 1, document, 4);
ok(a11yrange.crop(getAccessible(a)), "Range failed to crop #4.");
testTextRange(a11yrange, "cropped range #4", a, 1, a, 5);
// the range ends before the accessible
range.setStart(p.firstChild, 0);
range.setEnd(p.firstChild, 4);
- var a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
- var a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
+ a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
+ a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(a11yrange, "selection range #5", p, 0, p, 4);
ok(!a11yrange.crop(getAccessible(a)), "Crop #5 succeeded while it shouldn't");
// the range starts after the accessible
range.setStart(p.lastChild, 0);
range.setEnd(p.lastChild, 4);
- var a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
- var a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
+ a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
+ a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(a11yrange, "selection range #6", p, 6, p, 10);
ok(!a11yrange.crop(getAccessible(a)), "Crop #6 succeeded while it shouldn't");
// crop a range by a table
range.selectNode(getNode("c2"));
- var a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
- var a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
+ a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
+ a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
testTextRange(a11yrange, "selection range #7", document, 4, document, 5);
ok(a11yrange.crop(getAccessible("table")), "Range failed to crop #7.");
testTextRange(a11yrange, "cropped range #7", "c2", 5, "c2", 6);
SimpleTest.finish();
}
--- a/accessible/tests/mochitest/tree/test_aria_globals.html
+++ b/accessible/tests/mochitest/tree/test_aria_globals.html
@@ -34,29 +34,29 @@
"relevant"
];
// Elements having ARIA global state or properties or referred by another
// element must be accessible.
ok(isAccessible("pawn"),
"Must be accessible because referred by another element.");
- for (var idx = 0; idx < globalIds.length; idx++) {
+ for (let idx = 0; idx < globalIds.length; idx++) {
ok(isAccessible(globalIds[idx]),
"Must be accessible becuase of aria-" + globalIds[idx] +
" presence");
}
// Unfocusable elements, having ARIA global state or property with a valid
// IDREF value, and an inherited presentation role. A generic accessible
// is created (to prevent table cells text jamming).
ok(!isAccessible("td_nothing", nsIAccessibleTableCell),
"inherited presentation role takes a place");
- for (var idx = 0; idx < globalIds.length; idx++) {
+ for (let idx = 0; idx < globalIds.length; idx++) {
ok(isAccessible("td_" + globalIds[idx]),
"Inherited presentation role must be ignored becuase of " +
"aria-" + globalIds[idx] + " presence");
}
SimpleTest.finish();
}
--- a/accessible/tests/mochitest/tree/test_aria_grid.html
+++ b/accessible/tests/mochitest/tree/test_aria_grid.html
@@ -168,17 +168,17 @@
]
};
testAccessibleTree("crazy_grid4", accTree);
// ////////////////////////////////////////////////////////////////////////
// grids that could contain whitespace accessibles but shouldn't.
- var accTree =
+ accTree =
{ TREE_TABLE: [
{ ROW: [
{ GRID_CELL: [
{ TEXT_LEAF: [ ] }
] },
{ GRID_CELL: [
{ TEXT_LEAF: [ ] }
] },
--- a/accessible/tests/mochitest/tree/test_canvas.html
+++ b/accessible/tests/mochitest/tree/test_canvas.html
@@ -42,13 +42,13 @@ https://bugzilla.mozilla.org/show_bug.cg
</pre>
<canvas id="canvas" tabindex="0"><input type="checkbox"><input></canvas>
<script type="text/javascript">
var c = document.getElementById("canvas");
var cxt = c.getContext("2d");
cxt.fillStyle = "#005500";
- cxt.fillRect(0,0,150,75);
+ cxt.fillRect(0, 0, 150, 75);
</script>
</body>
</html>
--- a/accessible/tests/mochitest/tree/test_list.html
+++ b/accessible/tests/mochitest/tree/test_list.html
@@ -117,29 +117,29 @@
] }
] }
] }
] };
testAccessibleTree("list6", tree);
// li having no display:list-item style
- var tree =
+ tree =
{ LIST: [ // ul
{ LISTITEM: [ // li
{ TEXT_LEAF: [] },
] },
{ TEXT_LEAF: [] },
{ LISTITEM: [ // li
{ TEXT_LEAF: [] }
] }
] };
testAccessibleTree("list7", tree);
- var tree =
+ tree =
{ LIST: [ // ul
{ LISTITEM: [ // li
{ TEXT_LEAF: [] },
] },
{ LISTITEM: [ // li
{ TEXT_LEAF: [] }
] }
] };
--- a/accessible/tests/mochitest/tree/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/tree/test_tabbrowser.xul
@@ -110,37 +110,27 @@
{
// xul:tab ("about:license")
role: ROLE_PAGETAB,
children: [
{
// xul:text, i.e. the tab label text
role: ROLE_TEXT_LEAF,
children: []
- },
- {
- // xul:toolbarbutton ("Close Tab")
- role: ROLE_PUSHBUTTON,
- children: []
}
]
},
{
// tab ("about:mozilla")
role: ROLE_PAGETAB,
children: [
{
// xul:text, i.e. the tab label text
role: ROLE_TEXT_LEAF,
children: []
- },
- {
- // xul:toolbarbutton ("Close Tab")
- role: ROLE_PUSHBUTTON,
- children: []
}
]
},
{
// xul:toolbarbutton ("Open a new tab")
role: ROLE_PUSHBUTTON,
children: newTabChildren
}
--- a/accessible/tests/mochitest/treeupdate/a11y.ini
+++ b/accessible/tests/mochitest/treeupdate/a11y.ini
@@ -10,16 +10,17 @@ support-files =
[test_bug883708.xhtml]
[test_bug884251.xhtml]
[test_bug895082.html]
[test_bug1040735.html]
[test_bug1100602.html]
[test_bug1175913.html]
[test_bug1189277.html]
[test_bug1276857.html]
+support-files = test_bug1276857_subframe.html
[test_canvas.html]
[test_colorpicker.xul]
[test_contextmenu.xul]
[test_cssoverflow.html]
[test_deck.xul]
[test_doc.html]
[test_gencontent.html]
[test_general.html]
--- a/accessible/tests/mochitest/treeupdate/test_ariaowns.html
+++ b/accessible/tests/mochitest/treeupdate/test_ariaowns.html
@@ -401,21 +401,21 @@
this.getID = function showHiddenElement_getID() {
return "Show hidden ARIA owns referred element";
};
}
function rearrangeARIAOwns(aContainer, aAttr, aIdList, aRoleList) {
this.eventSeq = [];
- for (var id of aIdList) {
+ for (let id of aIdList) {
this.eventSeq.push(new invokerChecker(EVENT_HIDE, getNode(id)));
}
- for (var id of aIdList) {
+ for (let id of aIdList) {
this.eventSeq.push(new invokerChecker(EVENT_SHOW, getNode(id)));
}
this.eventSeq.push(new invokerChecker(EVENT_REORDER, getNode(aContainer)));
this.invoke = function rearrangeARIAOwns_invoke() {
getNode(aContainer).setAttribute("aria-owns", aAttr);
};
--- a/accessible/tests/mochitest/treeupdate/test_bug1040735.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1040735.html
@@ -9,17 +9,17 @@
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript">
function doTest() {
document.body.appendChild(document.getElementById("mw_a"));
- setTimeout(function() { ok(true, "no crash and assertions"); SimpleTest.finish(); } , 0);
+ setTimeout(function() { ok(true, "no crash and assertions"); SimpleTest.finish(); }, 0);
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
--- a/accessible/tests/mochitest/treeupdate/test_bug1276857.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1276857.html
@@ -13,80 +13,89 @@
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
function runTest() {
+ let iframe = document.getElementById("iframe");
+
// children change will recreate the table
this.eventSeq = [
- new invokerChecker(EVENT_REORDER, getNode("c1"))
+ new invokerChecker(EVENT_REORDER, () => {
+ let doc = getNode("iframe").contentDocument;
+ return doc && doc.getElementById("c1");
+ })
];
this.invoke = function runTest_invoke() {
var tree = {
SECTION: [ // c1
{ TEXT_LEAF: [] }, // Some text
{ TEXT_CONTAINER: [
{ TEXT_LEAF: [] } // something with ..
] },
{ TEXT_LEAF: [] } // More text
]
};
- testAccessibleTree("c1", tree);
+ testAccessibleTree(iframe.contentDocument.getElementById("c1"), tree);
- getNode("c1_t").querySelector("span").remove();
+ iframe.contentDocument.getElementById("c1_t").querySelector("span").remove();
};
this.finalCheck = function runTest_finalCheck() {
var tree = {
SECTION: [ // c1
{ TEXT_LEAF: [] }, // Some text
{ TEXT_LEAF: [] } // More text
]
};
- testAccessibleTree("c1", tree);
+ testAccessibleTree(iframe.contentDocument.getElementById("c1"), tree);
};
this.getID = function runTest_getID() {
return "child DOM node is removed before the layout notifies the a11y about parent removal/show";
};
}
function runShadowTest() {
// children change will recreate the table
this.eventSeq = [
- new invokerChecker(EVENT_REORDER, "c2")
+ new invokerChecker(EVENT_REORDER, () => {
+ let doc = getNode("iframe").contentDocument;
+ return doc && doc.getElementById("c2");
+ })
];
this.invoke = function runShadowTest_invoke() {
var tree = {
SECTION: [ // c2
{ TEXT_LEAF: [] }, // Some text
{ TEXT_CONTAINER: [
{ TEXT_LEAF: [] } // something with ..
] },
{ TEXT_LEAF: [] } // More text
]
};
- testAccessibleTree("c2", tree);
+ testAccessibleTree(iframe.contentDocument.getElementById("c2"), tree);
- gShadowRoot.firstElementChild.querySelector("span").remove();
+ var shadowRoot = iframe.contentDocument.getElementById("c2_c").shadowRoot;
+ shadowRoot.firstElementChild.querySelector("span").remove();
};
this.finalCheck = function runShadowTest_finalCheck() {
var tree = {
SECTION: [ // c2
{ TEXT_LEAF: [] }, // Some text
{ TEXT_LEAF: [] } // More text
]
};
- testAccessibleTree("c2", tree);
+ testAccessibleTree(iframe.contentDocument.getElementById("c2"), tree);
};
this.getID = function runShadowTest_getID() {
return "child DOM node is removed before the layout notifies the a11y about parent removal/show in shadow DOM";
};
}
// enableLogging("tree");
@@ -96,44 +105,27 @@
function doTest() {
gQueue = new eventQueue();
gQueue.push(new runTest());
gQueue.push(new runShadowTest());
gQueue.invoke(); // will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
- addA11yLoadEvent(doTest);
+ SpecialPowers.pushPrefEnv({
+ set: [
+ ["dom.webcomponents.shadowdom.enabled", true]
+ ]
+ }, function() {
+ // This test loads in an iframe, to ensure that the element instance is
+ // loaded with the correct value of the preference.
+ let iframe = document.createElement("iframe");
+ iframe.id = "iframe";
+ iframe.src = "test_bug1276857_subframe.html";
+ addA11yLoadEvent(doTest, iframe.contentWindow);
+ document.body.appendChild(iframe);
+ });
</script>
</head>
-
<body>
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test">
- </pre>
-
- <div id="c1">
- <div id="c1_t" style="display: table" role="presentation">
- Some text
- <span style="display: table-cell">something with accessibles goes here</span>
- More text
- </div>
- </div>
-
- <template id="tmpl">
- <div style="display: table" role="presentation">
- Some text
- <span style="display: table-cell">something with accessibles goes here</span>
- More text
- </div>
- </template>
-
- <div id="c2"><div id="c2_c" role="presentation"></div></div>
-
- <script>
- var gShadowRoot = document.getElementById("c2_c").createShadowRoot();
- var tmpl = document.getElementById("tmpl");
- gShadowRoot.appendChild(document.importNode(tmpl.content, true));
- </script>
</body>
</html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/treeupdate/test_bug1276857_subframe.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>DOM mutations test</title>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+ <script type="application/javascript" src="../role.js"></script>
+</head>
+<body>
+ <div id="c1">
+ <div id="c1_t" style="display: table" role="presentation">
+ Some text
+ <span style="display: table-cell">something with accessibles goes here</span>
+ More text
+ </div>
+ </div>
+
+ <template id="tmpl">
+ <div style="display: table" role="presentation">
+ Some text
+ <span style="display: table-cell">something with accessibles goes here</span>
+ More text
+ </div>
+ </template>
+
+ <div id="c2"><div id="c2_c" role="presentation"></div></div>
+
+ <script>
+ var gShadowRoot = document.getElementById("c2_c").attachShadow({mode: "open"});
+ var tmpl = document.getElementById("tmpl");
+ gShadowRoot.appendChild(document.importNode(tmpl.content, true));
+ </script>
+</body>
+</html>
--- a/accessible/tests/mochitest/treeview.js
+++ b/accessible/tests/mochitest/treeview.js
@@ -1,34 +1,34 @@
/**
* Helper method to start a single XUL tree test.
*/
function loadXULTreeAndDoTest(aDoTestFunc, aTreeID, aTreeView) {
var doTestFunc = aDoTestFunc ? aDoTestFunc : gXULTreeLoadContext.doTestFunc;
var treeID = aTreeID ? aTreeID : gXULTreeLoadContext.treeID;
var treeView = aTreeView ? aTreeView : gXULTreeLoadContext.treeView;
- function loadXULTree(aTreeID, aTreeView) {
- this.treeNode = getNode(aTreeID);
-
- this.eventSeq = [
- new invokerChecker(EVENT_REORDER, this.treeNode)
- ];
-
- this.invoke = function loadXULTree_invoke() {
- this.treeNode.view = aTreeView;
- };
-
- this.getID = function loadXULTree_getID() {
- return "Load XUL tree " + prettyName(aTreeID);
- };
- }
+ let treeNode = getNode(treeID);
gXULTreeLoadContext.queue = new eventQueue();
- gXULTreeLoadContext.queue.push(new loadXULTree(treeID, treeView));
+ gXULTreeLoadContext.queue.push({
+ treeNode,
+
+ eventSeq: [
+ new invokerChecker(EVENT_REORDER, treeNode)
+ ],
+
+ invoke() {
+ this.treeNode.view = treeView;
+ },
+
+ getID() {
+ return "Load XUL tree " + prettyName(treeID);
+ }
+ });
gXULTreeLoadContext.queue.onFinish = function() {
SimpleTest.executeSoon(doTestFunc);
return DO_NOT_FINISH_TEST;
};
gXULTreeLoadContext.queue.invoke();
}
/**
@@ -102,17 +102,16 @@ nsTreeView.prototype =
return info.parentIndex;
},
hasNextSibling: function hasNextSibling(aRowIndex, aAfterIndex) { },
getLevel: function getLevel(aIndex) {
var info = this.getInfoByIndex(aIndex);
return info.level;
},
getImageSrc: function getImageSrc(aRow, aCol) {},
- getProgressMode: function getProgressMode(aRow, aCol) {},
isContainer: function isContainer(aIndex) {
var data = this.getDataForIndex(aIndex);
return data.open != undefined;
},
isContainerOpen: function isContainerOpen(aIndex) {
var data = this.getDataForIndex(aIndex);
return data.open;
},
--- a/accessible/windows/ia2/ia2Accessible.cpp
+++ b/accessible/windows/ia2/ia2Accessible.cpp
@@ -517,17 +517,17 @@ ia2Accessible::get_accessibleWithCaret(I
*aCaretOffset = -1;
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
int32_t caretOffset = -1;
Accessible* accWithCaret = SelectionMgr()->AccessibleWithCaret(&caretOffset);
- if (acc->Document() != accWithCaret->Document())
+ if (!accWithCaret || acc->Document() != accWithCaret->Document())
return S_FALSE;
Accessible* child = accWithCaret;
while (!child->IsDoc() && child != acc)
child = child->Parent();
if (child != acc)
return S_FALSE;
--- a/accessible/windows/ia2/ia2AccessibleComponent.cpp
+++ b/accessible/windows/ia2/ia2AccessibleComponent.cpp
@@ -57,26 +57,26 @@ ia2AccessibleComponent::get_locationInPa
return S_OK;
nsIntRect rect = acc->Bounds();
// The coordinates of the returned position are relative to this object's
// parent or relative to the screen on which this object is rendered if it
// has no parent.
if (!acc->Parent()) {
- *aX = rect.x;
- *aY = rect.y;
+ *aX = rect.X();
+ *aY = rect.Y();
return S_OK;
}
// The coordinates of the bounding box are given relative to the parent's
// coordinate system.
nsIntRect parentRect = acc->Parent()->Bounds();
- *aX = rect.x - parentRect.x;
- *aY = rect.y - parentRect.y;
+ *aX = rect.X() - parentRect.X();
+ *aY = rect.Y() - parentRect.Y();
return S_OK;
}
STDMETHODIMP
ia2AccessibleComponent::get_foreground(IA2Color* aForeground)
{
if (!aForeground)
return E_INVALIDARG;
--- a/accessible/windows/ia2/ia2AccessibleText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleText.cpp
@@ -105,20 +105,21 @@ ia2AccessibleText::get_characterExtents(
nsIntRect rect;
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
rect = textAcc->CharBounds(aOffset, geckoCoordType);
- *aX = rect.x;
- *aY = rect.y;
- *aWidth = rect.width;
- *aHeight = rect.height;
+ // Can't use GetRect() because of long vs. int32_t mismatch
+ *aX = rect.X();
+ *aY = rect.Y();
+ *aWidth = rect.Width();
+ *aHeight = rect.Height();
return S_OK;
}
STDMETHODIMP
ia2AccessibleText::get_nSelections(long* aNSelections)
{
if (!aNSelections)
return E_INVALIDARG;
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -491,17 +491,17 @@ AccessibleWrap::get_accRole(
// Use BSTR role to expose role attribute or tag name + namespace
nsIContent *content = GetContent();
if (!content)
return E_FAIL;
if (content->IsElement()) {
nsAutoString roleString;
// Try the role attribute.
- content->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roleString);
+ content->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roleString);
if (roleString.IsEmpty()) {
// No role attribute (or it is an empty string).
// Use the tag name.
nsIDocument * document = content->GetUncomposedDoc();
if (!document)
return E_FAIL;
@@ -897,20 +897,20 @@ AccessibleWrap::accLocation(
if (accessible) {
return accessible->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight,
kVarChildIdSelf);
}
nsIntRect rect = Bounds();
- *pxLeft = rect.x;
- *pyTop = rect.y;
- *pcxWidth = rect.width;
- *pcyHeight = rect.height;
+ *pxLeft = rect.X();
+ *pyTop = rect.Y();
+ *pcxWidth = rect.Width();
+ *pcyHeight = rect.Height();
return S_OK;
}
STDMETHODIMP
AccessibleWrap::accNavigate(
/* [in] */ long navDir,
/* [optional][in] */ VARIANT varStart,
/* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt)
@@ -1431,16 +1431,29 @@ GetProxiedAccessibleInSubtree(const DocA
RefPtr<IDispatch> disp;
if (FAILED(comProxy->get_accChild(aVarChild, getter_AddRefs(disp)))) {
return nullptr;
}
return disp.forget();
}
+bool
+AccessibleWrap::IsRootForHWND()
+{
+ if (IsRoot()) {
+ return true;
+ }
+ HWND thisHwnd = GetHWNDFor(this);
+ AccessibleWrap* parent = static_cast<AccessibleWrap*>(Parent());
+ MOZ_ASSERT(parent);
+ HWND parentHwnd = GetHWNDFor(parent);
+ return thisHwnd != parentHwnd;
+}
+
already_AddRefed<IAccessible>
AccessibleWrap::GetIAccessibleFor(const VARIANT& aVarChild, bool* aIsDefunct)
{
if (aVarChild.vt != VT_I4)
return nullptr;
VARIANT varChild = aVarChild;
@@ -1479,18 +1492,19 @@ AccessibleWrap::GetIAccessibleFor(const
// find it here and should look remotely instead. This handles the case when
// accessible is part of the chrome process and is part of the xul browser
// window and the child id points in the content documents. Thus we need to
// make sure that it is never called on proxies.
// Bug 1422674: We must only handle remote ids here (< 0), not child indices.
// Child indices (> 0) are handled below for both local and remote children.
if (XRE_IsParentProcess() && !IsProxy() &&
varChild.lVal < 0 && !sIDGen.IsChromeID(varChild.lVal)) {
- if (!IsRoot()) {
- // Bug 1422201: accChild with a remote id is only valid on the root accessible.
+ if (!IsRootForHWND()) {
+ // Bug 1422201, 1424657: accChild with a remote id is only valid on the
+ // root accessible for an HWND.
// Otherwise, we might return remote accessibles which aren't descendants
// of this accessible. This would confuse clients which use accChild to
// check whether something is a descendant of a document.
return nullptr;
}
return GetRemoteIAccessibleFor(varChild);
}
@@ -1642,22 +1656,22 @@ AccessibleWrap::UpdateSystemCaretFor(HWN
const LayoutDeviceIntRect& aCaretRect)
{
if (!aCaretWnd || aCaretRect.IsEmpty()) {
return;
}
// Create invisible bitmap for caret, otherwise its appearance interferes
// with Gecko caret
- nsAutoBitmap caretBitMap(CreateBitmap(1, aCaretRect.height, 1, 1, nullptr));
- if (::CreateCaret(aCaretWnd, caretBitMap, 1, aCaretRect.height)) { // Also destroys the last caret
+ nsAutoBitmap caretBitMap(CreateBitmap(1, aCaretRect.Height(), 1, 1, nullptr));
+ if (::CreateCaret(aCaretWnd, caretBitMap, 1, aCaretRect.Height())) { // Also destroys the last caret
::ShowCaret(aCaretWnd);
RECT windowRect;
::GetWindowRect(aCaretWnd, &windowRect);
- ::SetCaretPos(aCaretRect.x - windowRect.left, aCaretRect.y - windowRect.top);
+ ::SetCaretPos(aCaretRect.X() - windowRect.left, aCaretRect.Y() - windowRect.top);
}
}
ITypeInfo*
AccessibleWrap::GetTI(LCID lcid)
{
if (gTypeInfo)
return gTypeInfo;
--- a/accessible/windows/msaa/AccessibleWrap.h
+++ b/accessible/windows/msaa/AccessibleWrap.h
@@ -176,16 +176,22 @@ public: // construction, destruction
const LayoutDeviceIntRect& aCaretRect);
private:
static void UpdateSystemCaretFor(HWND aCaretWnd,
const LayoutDeviceIntRect& aCaretRect);
public:
/**
+ * Determine whether this is the root accessible for its HWND.
+ */
+ bool
+ IsRootForHWND();
+
+ /**
* Find an accessible by the given child ID in cached documents.
*/
MOZ_MUST_USE already_AddRefed<IAccessible>
GetIAccessibleFor(const VARIANT& aVarChild, bool* aIsDefunct);
virtual void GetNativeInterface(void **aOutAccessible) override;
static IDispatch* NativeAccessible(Accessible* aAccessible);
--- a/accessible/windows/msaa/CompatibilityUIA.cpp
+++ b/accessible/windows/msaa/CompatibilityUIA.cpp
@@ -2,20 +2,23 @@
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "Compatibility.h"
#include "mozilla/Telemetry.h"
+#include "mozilla/WindowsVersion.h"
+#include "nsDataHashtable.h"
#include "nsPrintfCString.h"
#include "nsReadableUtils.h"
#include "nsString.h"
+#include "nsTHashtable.h"
#include "nsUnicharUtils.h"
#include "nsWinUtils.h"
#include "NtUndoc.h"
#if defined(UIA_LOGGING)
#define LOG_ERROR(FuncName) \
@@ -26,42 +29,112 @@
}
#else
#define LOG_ERROR(FuncName)
#endif // defined(UIA_LOGGING)
-static bool
-GetLocalObjectHandle(DWORD aSrcPid, HANDLE aSrcHandle, nsAutoHandle& aProcess,
- nsAutoHandle& aLocal)
+struct ByteArrayDeleter
{
- aLocal.reset();
+ void operator()(void* aBuf)
+ {
+ delete[] reinterpret_cast<char*>(aBuf);
+ }
+};
+
+typedef UniquePtr<OBJECT_DIRECTORY_INFORMATION, ByteArrayDeleter> ObjDirInfoPtr;
- if (!aProcess) {
- HANDLE rawProcess = ::OpenProcess(PROCESS_DUP_HANDLE, FALSE, aSrcPid);
- if (!rawProcess) {
- LOG_ERROR(OpenProcess);
- return false;
- }
-
- aProcess.own(rawProcess);
+// ComparatorFnT returns true to continue searching, or else false to indicate
+// search completion.
+template <typename ComparatorFnT>
+static bool
+FindNamedObject(ComparatorFnT aComparator)
+{
+ // We want to enumerate every named kernel object in our session. We do this
+ // by opening a directory object using a path constructed using the session
+ // id under which our process resides.
+ DWORD sessionId;
+ if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &sessionId)) {
+ return false;
}
- HANDLE rawDuped;
- if (!::DuplicateHandle(aProcess.get(), aSrcHandle, ::GetCurrentProcess(),
- &rawDuped, GENERIC_READ, FALSE, 0)) {
- LOG_ERROR(DuplicateHandle);
+ nsAutoString path;
+ path.AppendPrintf("\\Sessions\\%u\\BaseNamedObjects", sessionId);
+
+ UNICODE_STRING baseNamedObjectsName;
+ ::RtlInitUnicodeString(&baseNamedObjectsName, path.get());
+
+ OBJECT_ATTRIBUTES attributes;
+ InitializeObjectAttributes(&attributes, &baseNamedObjectsName, 0,
+ nullptr, nullptr);
+
+ HANDLE rawBaseNamedObjects;
+ NTSTATUS ntStatus = ::NtOpenDirectoryObject(&rawBaseNamedObjects,
+ DIRECTORY_QUERY | DIRECTORY_TRAVERSE,
+ &attributes);
+ if (!NT_SUCCESS(ntStatus)) {
return false;
}
- aLocal.own(rawDuped);
+ nsAutoHandle baseNamedObjects(rawBaseNamedObjects);
+
+ ULONG context = 0, returnedLen;
+
+ ULONG objDirInfoBufLen = 1024 * sizeof(OBJECT_DIRECTORY_INFORMATION);
+ ObjDirInfoPtr objDirInfo(
+ reinterpret_cast<OBJECT_DIRECTORY_INFORMATION*>(new char[objDirInfoBufLen]));
+
+ // Now query that directory object for every named object that it contains.
+
+ BOOL firstCall = TRUE;
- return true;
+ do {
+ ntStatus = ::NtQueryDirectoryObject(baseNamedObjects, objDirInfo.get(),
+ objDirInfoBufLen, FALSE, firstCall,
+ &context, &returnedLen);
+#if defined(HAVE_64BIT_BUILD)
+ if (!NT_SUCCESS(ntStatus)) {
+ return false;
+ }
+#else
+ if (ntStatus == STATUS_BUFFER_TOO_SMALL) {
+ // This case only occurs on 32-bit builds running atop WOW64.
+ // (See https://bugzilla.mozilla.org/show_bug.cgi?id=1423999#c3)
+ objDirInfo.reset(reinterpret_cast<OBJECT_DIRECTORY_INFORMATION*>(new char[returnedLen]));
+ objDirInfoBufLen = returnedLen;
+ continue;
+ } else if (!NT_SUCCESS(ntStatus)) {
+ return false;
+ }
+#endif
+
+ // NtQueryDirectoryObject gave us an array of OBJECT_DIRECTORY_INFORMATION
+ // structures whose final entry is zeroed out.
+ OBJECT_DIRECTORY_INFORMATION* curDir = objDirInfo.get();
+ while (curDir->mName.Length && curDir->mTypeName.Length) {
+ // We use nsDependentSubstring here because UNICODE_STRINGs are not
+ // guaranteed to be null-terminated.
+ nsDependentSubstring objName(curDir->mName.Buffer,
+ curDir->mName.Length / sizeof(wchar_t));
+ nsDependentSubstring typeName(curDir->mTypeName.Buffer,
+ curDir->mTypeName.Length / sizeof(wchar_t));
+
+ if (!aComparator(objName, typeName)) {
+ return true;
+ }
+
+ ++curDir;
+ }
+
+ firstCall = FALSE;
+ } while (ntStatus == STATUS_MORE_ENTRIES);
+
+ return false;
}
namespace mozilla {
namespace a11y {
Maybe<DWORD> Compatibility::sUiaRemotePid;
Maybe<bool>
@@ -69,215 +142,164 @@ Compatibility::OnUIAMessage(WPARAM aWPar
{
Maybe<DWORD>& remotePid = sUiaRemotePid;
auto clearUiaRemotePid = MakeScopeExit([&remotePid]() {
remotePid = Nothing();
});
Telemetry::AutoTimer<Telemetry::A11Y_UIA_DETECTION_TIMING_MS> timer;
- static auto pNtQuerySystemInformation =
- reinterpret_cast<decltype(&::NtQuerySystemInformation)>(
- ::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"),
- "NtQuerySystemInformation"));
-
- static auto pNtQueryObject =
- reinterpret_cast<decltype(&::NtQueryObject)>(
- ::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"), "NtQueryObject"));
-
// UIA creates a section containing the substring "HOOK_SHMEM_"
NS_NAMED_LITERAL_STRING(kStrHookShmem, "HOOK_SHMEM_");
// The section name always ends with this suffix, which is derived from the
// current thread id and the UIA message's WPARAM and LPARAM.
nsAutoString partialSectionSuffix;
partialSectionSuffix.AppendPrintf("_%08x_%08x_%08x", ::GetCurrentThreadId(),
- aLParam, aWParam);
+ static_cast<DWORD>(aLParam), aWParam);
+
+ // Find any named Section that matches the naming convention of the UIA shared
+ // memory.
+ nsAutoHandle section;
+ auto comparator = [&](const nsDependentSubstring& aName,
+ const nsDependentSubstring& aType) -> bool {
+ if (aType.Equals(NS_LITERAL_STRING("Section")) &&
+ FindInReadable(kStrHookShmem, aName) &&
+ StringEndsWith(aName, partialSectionSuffix)) {
+ section.own(::OpenFileMapping(GENERIC_READ, FALSE,
+ PromiseFlatString(aName).get()));
+ return false;
+ }
+
+ return true;
+ };
+
+ if (!FindNamedObject(comparator) || !section) {
+ return Nothing();
+ }
NTSTATUS ntStatus;
// First we must query for a list of all the open handles in the system.
UniquePtr<char[]> handleInfoBuf;
ULONG handleInfoBufLen = sizeof(SYSTEM_HANDLE_INFORMATION_EX) +
1024 * sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX);
// We must query for handle information in a loop, since we are effectively
// asking the kernel to take a snapshot of all the handles on the system;
// the size of the required buffer may fluctuate between successive calls.
while (true) {
handleInfoBuf = MakeUnique<char[]>(handleInfoBufLen);
- ntStatus = pNtQuerySystemInformation(
+ ntStatus = ::NtQuerySystemInformation(
(SYSTEM_INFORMATION_CLASS) SystemExtendedHandleInformation,
handleInfoBuf.get(), handleInfoBufLen, &handleInfoBufLen);
if (ntStatus == STATUS_INFO_LENGTH_MISMATCH) {
continue;
}
if (!NT_SUCCESS(ntStatus)) {
return Nothing();
}
break;
}
- // Now we iterate through the system handle list, searching for a section
- // handle whose name matches the section name used by UIA.
-
- static Maybe<USHORT> sSectionObjTypeIndex;
-
const DWORD ourPid = ::GetCurrentProcessId();
-
Maybe<PVOID> kernelObject;
-
- ULONG lastPid = 0;
- nsAutoHandle process;
+ static Maybe<USHORT> sectionObjTypeIndex;
+ nsTHashtable<nsUint32HashKey> nonSectionObjTypes;
+ nsDataHashtable<nsVoidPtrHashKey, DWORD> objMap;
auto handleInfo = reinterpret_cast<SYSTEM_HANDLE_INFORMATION_EX*>(handleInfoBuf.get());
for (ULONG index = 0; index < handleInfo->mHandleCount; ++index) {
SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX& curHandle = handleInfo->mHandles[index];
- if (lastPid && lastPid == curHandle.mPid && !process) {
- // During the previous iteration, we could not obtain a handle for this
- // pid. Skip any remaining handles belonging to that pid.
- continue;
- }
-
- // As a perf optimization, we reuse the same process handle as long as we're
- // still looking at the same pid. Once the pid changes, we need to reset
- // process so that we open a new handle to the newly-seen process.
- if (lastPid != curHandle.mPid) {
- process.reset();
- }
+ HANDLE handle = reinterpret_cast<HANDLE>(curHandle.mHandle);
- nsAutoHandle handle;
-
- if (kernelObject.isSome() && kernelObject.value() == curHandle.mObject) {
- // If we know the value of the underlying kernel object, we can immediately
- // check for equality by comparing against curHandle.mObject
- remotePid = Some(static_cast<DWORD>(curHandle.mPid));
- break;
- } else if (sSectionObjTypeIndex.isSome()) {
- // Otherwise, if we know which object type value corresponds to a Section
- // object, we can use that to eliminate any handles that are not sections.
- if (curHandle.mObjectTypeIndex != sSectionObjTypeIndex.value()) {
- // Not a section handle
+ // The mapping of the curHandle.mObjectTypeIndex field depends on the
+ // underlying OS kernel. As we scan through the handle list, we record the
+ // type indices such that we may use those values to skip over handles that
+ // refer to non-section objects.
+ if (sectionObjTypeIndex) {
+ // If we know the type index for Sections, that's the fastest check...
+ if (sectionObjTypeIndex.value() != curHandle.mObjectTypeIndex) {
+ // Not a section
continue;
}
- } else {
- // Otherwise we need to query the handle to determine its type. Note that
- // each handle in the system list is relative to its owning process, so
- // we cannot do anything with it until we duplicate the handle into our
- // own process.
-
- lastPid = curHandle.mPid;
-
- if (!GetLocalObjectHandle((DWORD) curHandle.mPid,
- (HANDLE) curHandle.mHandle,
- process, handle)) {
- // We don't have access to do this, assume this handle isn't relevant
- continue;
- }
-
- // Now we have our own handle to the object, lets find out what type of
- // object this handle represents. Any handle whose type is not "Section"
- // is of no interest to us.
+ } else if (nonSectionObjTypes.Contains(static_cast<uint32_t>(
+ curHandle.mObjectTypeIndex))) {
+ // Otherwise we check whether or not the object type is definitely _not_
+ // a Section...
+ continue;
+ } else if (ourPid == curHandle.mPid) {
+ // Otherwise we need to issue some system calls to find out the object
+ // type corresponding to the current handle's type index.
ULONG objTypeBufLen;
- ntStatus = pNtQueryObject(handle, ObjectTypeInformation, nullptr,
- 0, &objTypeBufLen);
+ ntStatus = ::NtQueryObject(handle, ObjectTypeInformation,
+ nullptr, 0, &objTypeBufLen);
if (ntStatus != STATUS_INFO_LENGTH_MISMATCH) {
continue;
}
auto objTypeBuf = MakeUnique<char[]>(objTypeBufLen);
- ntStatus = pNtQueryObject(handle, ObjectTypeInformation, objTypeBuf.get(),
- objTypeBufLen, &objTypeBufLen);
+ ntStatus = ::NtQueryObject(handle, ObjectTypeInformation, objTypeBuf.get(),
+ objTypeBufLen, &objTypeBufLen);
if (!NT_SUCCESS(ntStatus)) {
- // We don't have access to do this, assume this handle isn't relevant
continue;
}
auto objType =
reinterpret_cast<PUBLIC_OBJECT_TYPE_INFORMATION*>(objTypeBuf.get());
- nsDependentString objTypeName(objType->TypeName.Buffer,
- objType->TypeName.Length / sizeof(wchar_t));
+ // Now we check whether the object's type name matches "Section"
+ nsDependentSubstring objTypeName(objType->TypeName.Buffer,
+ objType->TypeName.Length / sizeof(wchar_t));
if (!objTypeName.Equals(NS_LITERAL_STRING("Section"))) {
- // Not a section, so we don't care about this handle anymore.
+ nonSectionObjTypes.PutEntry(static_cast<uint32_t>(curHandle.mObjectTypeIndex));
continue;
}
- // We have a section, save this handle's type code so that we can go
- // faster in future iterations.
- sSectionObjTypeIndex = Some(curHandle.mObjectTypeIndex);
- }
-
- // If we reached this point without needing to query the handle, then we
- // need to open it here so that we can query its name.
- lastPid = curHandle.mPid;
-
- if ((!process || !handle) &&
- !GetLocalObjectHandle((DWORD) curHandle.mPid, (HANDLE) curHandle.mHandle,
- process, handle)) {
- // We don't have access to do this, assume this handle isn't relevant
- continue;
- }
-
- // At this point, |handle| is a valid section handle. Let's try to find
- // out the name of its underlying object.
- ULONG objNameBufLen;
- ntStatus = pNtQueryObject(handle,
- (OBJECT_INFORMATION_CLASS)ObjectNameInformation,
- nullptr, 0, &objNameBufLen);
- if (ntStatus != STATUS_INFO_LENGTH_MISMATCH) {
- continue;
- }
-
- auto objNameBuf = MakeUnique<char[]>(objNameBufLen);
- ntStatus = pNtQueryObject(handle,
- (OBJECT_INFORMATION_CLASS)ObjectNameInformation,
- objNameBuf.get(), objNameBufLen, &objNameBufLen);
- if (!NT_SUCCESS(ntStatus)) {
- continue;
+ sectionObjTypeIndex = Some(curHandle.mObjectTypeIndex);
}
- auto objNameInfo = reinterpret_cast<OBJECT_NAME_INFORMATION*>(objNameBuf.get());
- if (!objNameInfo->mName.Length) {
- // This section is unnamed. We don't care about those.
- continue;
- }
+ // At this point we know that curHandle references a Section object.
+ // Now we can do some actual tests on it.
- nsDependentString objName(objNameInfo->mName.Buffer,
- objNameInfo->mName.Length / sizeof(wchar_t));
-
- // Check to see if the section's name matches our expected name.
- if (!FindInReadable(kStrHookShmem, objName) ||
- !StringEndsWith(objName, partialSectionSuffix)) {
- // The names don't match, continue searching.
- continue;
- }
+ if (ourPid != curHandle.mPid) {
+ if (kernelObject && kernelObject.value() == curHandle.mObject) {
+ // The kernel objects match -- we have found the remote pid!
+ remotePid = Some(curHandle.mPid);
+ break;
+ }
- // At this point we have a section handle whose name matches the one that
- // we're looking for.
-
- if (curHandle.mPid == ourPid) {
- // Our own process also has a handle to the section of interest. While we
- // don't want our own pid, this *does* give us an opportunity to speed up
- // future iterations by examining each handle for its kernel object (which
- // is the same for all processes) instead of searching by name.
+ // An object that is not ours. Since we do not yet know which kernel
+ // object we're interested in, we'll save the current object for later.
+ objMap.Put(curHandle.mObject, curHandle.mPid);
+ } else if (handle == section.get()) {
+ // This is the file mapping that we opened above. We save this mObject
+ // in order to compare to Section objects opened by other processes.
kernelObject = Some(curHandle.mObject);
- continue;
}
+ }
+
+ if (!kernelObject) {
+ return Nothing();
+ }
- // Bingo! We want this pid!
- remotePid = Some(static_cast<DWORD>(curHandle.mPid));
+ if (!remotePid) {
+ // We found kernelObject *after* we saw the remote process's copy. Now we
+ // must look it up in objMap.
+ DWORD pid;
+ if (objMap.Get(kernelObject.value(), &pid)) {
+ remotePid = Some(pid);
+ }
+ }
- break;
- }
if (!remotePid) {
return Nothing();
}
a11y::SetInstantiator(remotePid.value());
/* This is where we could block UIA stuff
--- a/accessible/windows/msaa/DocAccessibleWrap.cpp
+++ b/accessible/windows/msaa/DocAccessibleWrap.cpp
@@ -149,33 +149,33 @@ DocAccessibleWrap::DoInitialUpdate()
// Create window for tab document.
if (mDocFlags & eTabDocument) {
a11y::RootAccessible* rootDocument = RootAccessible();
bool isActive = true;
nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
if (Compatibility::IsDolphin()) {
rect = Bounds();
nsIntRect rootRect = rootDocument->Bounds();
- rect.x = rootRect.x - rect.x;
- rect.y -= rootRect.y;
+ rect.MoveToX(rootRect.X() - rect.X());
+ rect.MoveByY(-rootRect.Y());
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
docShell->GetIsActive(&isActive);
}
RefPtr<DocAccessibleWrap> self(this);
nsWinUtils::NativeWindowCreateProc onCreate([self](HWND aHwnd) -> void {
::SetPropW(aHwnd, kPropNameDocAcc, reinterpret_cast<HANDLE>(self.get()));
});
HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow());
mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd,
- rect.x, rect.y,
- rect.width, rect.height, isActive,
+ rect.X(), rect.Y(),
+ rect.Width(), rect.Height(), isActive,
&onCreate);
} else {
DocAccessible* parentDocument = ParentDocument();
if (parentDocument)
mHWND = parentDocument->GetNativeWindow();
}
}
}
--- a/accessible/windows/msaa/NtUndoc.h
+++ b/accessible/windows/msaa/NtUndoc.h
@@ -4,20 +4,32 @@
* 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/. */
#ifndef mozilla_NtUndoc_h
#define mozilla_NtUndoc_h
#include <winternl.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#ifndef STATUS_INFO_LENGTH_MISMATCH
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
#endif
+#ifndef STATUS_BUFFER_TOO_SMALL
+#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
+#endif
+
+#ifndef STATUS_MORE_ENTRIES
+#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105L)
+#endif
+
enum UndocSystemInformationClass
{
SystemExtendedHandleInformation = 64
};
struct SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
{
PVOID mObject;
@@ -42,9 +54,41 @@ enum UndocObjectInformationClass
ObjectNameInformation = 1
};
struct OBJECT_NAME_INFORMATION
{
UNICODE_STRING mName;
};
+// The following declarations are documented on MSDN but are not included in
+// public user-mode headers.
+
+enum DirectoryObjectAccessFlags
+{
+ DIRECTORY_QUERY = 0x0001,
+ DIRECTORY_TRAVERSE = 0x0002,
+ DIRECTORY_CREATE_OBJECT = 0x0004,
+ DIRECTORY_CREATE_SUBDIRECTORY = 0x0008,
+ DIRECTORY_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | 0x000F
+};
+
+NTSTATUS WINAPI
+NtOpenDirectoryObject(PHANDLE aDirectoryHandle, ACCESS_MASK aDesiredAccess,
+ POBJECT_ATTRIBUTES aObjectAttributes);
+
+struct OBJECT_DIRECTORY_INFORMATION
+{
+ UNICODE_STRING mName;
+ UNICODE_STRING mTypeName;
+};
+
+NTSTATUS WINAPI
+NtQueryDirectoryObject(HANDLE aDirectoryHandle, PVOID aOutBuffer,
+ ULONG aBufferLength, BOOLEAN aReturnSingleEntry,
+ BOOLEAN aRestartScan, PULONG aContext,
+ PULONG aOutReturnLength);
+
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // mozilla_NtUndoc_h
--- a/accessible/windows/msaa/XULMenuAccessibleWrap.cpp
+++ b/accessible/windows/msaa/XULMenuAccessibleWrap.cpp
@@ -23,14 +23,16 @@ XULMenuitemAccessibleWrap::Name(nsString
{
// XXX This should be done in MSAA's get_accName() so that Accessible::Name()]
// provides the same results on all platforms
XULMenuitemAccessible::Name(aName);
if (aName.IsEmpty())
return eNameOK;
nsAutoString accel;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::acceltext, accel);
+ if (mContent->IsElement()) {
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::acceltext, accel);
+ }
if (!accel.IsEmpty())
aName += NS_LITERAL_STRING("\t") + accel;
return eNameOK;
}
--- a/accessible/windows/msaa/moz.build
+++ b/accessible/windows/msaa/moz.build
@@ -41,16 +41,20 @@ UNIFIED_SOURCES += [
SOURCES += [
# This file cannot be built in unified mode because it redefines _WIN32_WINNT
'LazyInstantiator.cpp',
# This file cannot be built in unified mode because it includes ISimpleDOMNode_i.c.
'ServiceProvider.cpp',
]
+OS_LIBS += [
+ 'ntdll',
+]
+
if CONFIG['MOZ_XUL']:
UNIFIED_SOURCES += [
'XULListboxAccessibleWrap.cpp',
'XULMenuAccessibleWrap.cpp',
'XULTreeGridAccessibleWrap.cpp',
]
LOCAL_INCLUDES += [
--- a/accessible/windows/msaa/nsWinUtils.cpp
+++ b/accessible/windows/msaa/nsWinUtils.cpp
@@ -34,35 +34,34 @@ const wchar_t* kPropNameTabContent = L"A
/**
* WindowProc to process WM_GETOBJECT messages, used in windows emulation mode.
*/
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam);
bool nsWinUtils::sWindowEmulationStarted = false;
-already_AddRefed<nsIDOMCSSStyleDeclaration>
+already_AddRefed<nsICSSDeclaration>
nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aContent);
if (!elm)
return nullptr;
// Returns number of items in style declaration
nsCOMPtr<nsPIDOMWindowInner> window = elm->OwnerDoc()->GetInnerWindow();
if (!window)
return nullptr;
ErrorResult dummy;
- nsCOMPtr<nsICSSDeclaration> cssDecl;
nsCOMPtr<Element> domElement(do_QueryInterface(elm));
- cssDecl = window->GetComputedStyle(*domElement, EmptyString(), dummy);
- nsCOMPtr<nsIDOMCSSStyleDeclaration> domDecl = do_QueryInterface(cssDecl);
+ nsCOMPtr<nsICSSDeclaration> cssDecl =
+ window->GetComputedStyle(*domElement, EmptyString(), dummy);
dummy.SuppressException();
- return domDecl.forget();
+ return cssDecl.forget();
}
bool
nsWinUtils::MaybeStartWindowEmulation()
{
// Register window class that'll be used for document accessibles associated
// with tabs.
if (IPCAccessibilityActive())
--- a/accessible/windows/msaa/nsWinUtils.h
+++ b/accessible/windows/msaa/nsWinUtils.h
@@ -6,17 +6,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsWinUtils_h_
#define nsWinUtils_h_
#include <functional>
#include <windows.h>
-#include "nsIDOMCSSStyleDeclaration.h"
+#include "nsICSSDeclaration.h"
#include "nsCOMPtr.h"
class nsIContent;
namespace mozilla {
namespace a11y {
class DocAccessible;
@@ -30,17 +30,17 @@ class nsWinUtils
{
public:
/**
* Return computed styles declaration for the given node.
*
* @note Please use it carefully since it can shutdown the accessible tree
* you operate on.
*/
- static already_AddRefed<nsIDOMCSSStyleDeclaration>
+ static already_AddRefed<nsICSSDeclaration>
GetComputedStyleDeclaration(nsIContent* aContent);
/**
* Start window emulation if presence of specific AT is detected.
*/
static bool MaybeStartWindowEmulation();
/**
--- a/accessible/windows/sdn/sdnAccessible.cpp
+++ b/accessible/windows/sdn/sdnAccessible.cpp
@@ -8,17 +8,17 @@
#include "ISimpleDOM_i.c"
#include "DocAccessibleWrap.h"
#include "nsAttrName.h"
#include "nsCoreUtils.h"
#include "nsIAccessibleTypes.h"
#include "nsIDOMHTMLElement.h"
-#include "nsIDOMCSSStyleDeclaration.h"
+#include "nsICSSDeclaration.h"
#include "nsNameSpaceManager.h"
#include "nsServiceManagerUtils.h"
#include "nsWinUtils.h"
#include "nsRange.h"
#include "mozilla/dom/BorrowedAttrInfo.h"
#include "mozilla/dom/Element.h"
@@ -226,30 +226,31 @@ sdnAccessible::get_computedStyle(unsigne
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
*aNumStyleProperties = 0;
if (mNode->IsNodeOfType(nsINode::eDOCUMENT))
return S_FALSE;
- nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
+ nsCOMPtr<nsICSSDeclaration> cssDecl =
nsWinUtils::GetComputedStyleDeclaration(mNode->AsContent());
NS_ENSURE_TRUE(cssDecl, E_FAIL);
uint32_t length = 0;
cssDecl->GetLength(&length);
uint32_t index = 0, realIndex = 0;
for (index = realIndex = 0; index < length && realIndex < aMaxStyleProperties;
index ++) {
nsAutoString property, value;
// Ignore -moz-* properties.
- if (NS_SUCCEEDED(cssDecl->Item(index, property)) && property.CharAt(0) != '-')
+ cssDecl->Item(index, property);
+ if (property.CharAt(0) != '-')
cssDecl->GetPropertyValue(property, value); // Get property value
if (!value.IsEmpty()) {
aStyleProperties[realIndex] = ::SysAllocString(property.get());
aStyleValues[realIndex] = ::SysAllocString(value.get());
++realIndex;
}
}
@@ -269,17 +270,17 @@ sdnAccessible::get_computedStyleForPrope
return E_INVALIDARG;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (mNode->IsNodeOfType(nsINode::eDOCUMENT))
return S_FALSE;
- nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
+ nsCOMPtr<nsICSSDeclaration> cssDecl =
nsWinUtils::GetComputedStyleDeclaration(mNode->AsContent());
NS_ENSURE_TRUE(cssDecl, E_FAIL);
uint32_t index = 0;
for (index = 0; index < aNumStyleProperties; index++) {
nsAutoString value;
if (aStyleProperties[index])
cssDecl->GetPropertyValue(nsDependentString(aStyleProperties[index]), value); // Get property value
@@ -408,17 +409,17 @@ sdnAccessible::get_childAt(unsigned aChi
{
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
- nsINode* resultNode = mNode->GetChildAt(aChildIndex);
+ nsINode* resultNode = mNode->GetChildAt_Deprecated(aChildIndex);
if (resultNode) {
*aNode = static_cast<ISimpleDOMNode*>(new sdnAccessible(resultNode));
(*aNode)->AddRef();
}
return S_OK;
}
--- a/accessible/windows/sdn/sdnTextAccessible.cpp
+++ b/accessible/windows/sdn/sdnTextAccessible.cpp
@@ -70,20 +70,20 @@ sdnTextAccessible::get_clippedSubstringB
"There must always be a doc accessible, but there isn't. Crash!");
nsIntRect docRect = document->Bounds();
nsIntRect unclippedRect(x, y, width, height);
nsIntRect clippedRect;
clippedRect.IntersectRect(unclippedRect, docRect);
- *aX = clippedRect.x;
- *aY = clippedRect.y;
- *aWidth = clippedRect.width;
- *aHeight = clippedRect.height;
+ *aX = clippedRect.X();
+ *aY = clippedRect.Y();
+ *aWidth = clippedRect.Width();
+ *aHeight = clippedRect.Height();
return S_OK;
}
STDMETHODIMP
sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex,
unsigned int aEndIndex,
int __RPC_FAR* aX,
int __RPC_FAR* aY,
@@ -107,27 +107,27 @@ sdnTextAccessible::get_unclippedSubstrin
return E_FAIL;
nsRect sum;
nsIFrame* iter = startFrame;
nsIFrame* stopLoopFrame = endFrame->GetNextContinuation();
for (; iter != stopLoopFrame; iter = iter->GetNextContinuation()) {
nsRect rect = iter->GetScreenRectInAppUnits();
nscoord start = (iter == startFrame) ? startPoint.x : 0;
- nscoord end = (iter == endFrame) ? endPoint.x : rect.width;
- rect.x += start;
- rect.width = end - start;
+ nscoord end = (iter == endFrame) ? endPoint.x : rect.Width();
+ rect.MoveByX(start);
+ rect.SetWidth(end - start);
sum.UnionRect(sum, rect);
}
nsPresContext* presContext = mAccessible->Document()->PresContext();
- *aX = presContext->AppUnitsToDevPixels(sum.x);
- *aY = presContext->AppUnitsToDevPixels(sum.y);
- *aWidth = presContext->AppUnitsToDevPixels(sum.width);
- *aHeight = presContext->AppUnitsToDevPixels(sum.height);
+ *aX = presContext->AppUnitsToDevPixels(sum.X());
+ *aY = presContext->AppUnitsToDevPixels(sum.Y());
+ *aWidth = presContext->AppUnitsToDevPixels(sum.Width());
+ *aHeight = presContext->AppUnitsToDevPixels(sum.Height());
return S_OK;
}
STDMETHODIMP
sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex,
unsigned int aEndIndex)
{
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -447,21 +447,17 @@ xpcAccessible::GetBounds(int32_t* aX, in
nsIntRect rect;
if (Accessible* acc = IntlGeneric().AsAccessible()) {
rect = acc->Bounds();
} else {
rect = IntlGeneric().AsProxy()->Bounds();
}
- *aX = rect.x;
- *aY = rect.y;
- *aWidth = rect.width;
- *aHeight = rect.height;
-
+ rect.GetRect(aX, aY, aWidth, aHeight);
return NS_OK;
}
NS_IMETHODIMP
xpcAccessible::GroupPosition(int32_t* aGroupLevel,
int32_t* aSimilarItemsInGroup,
int32_t* aPositionInGroup)
{
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -265,18 +265,17 @@ xpcAccessibleHyperText::GetCharacterExte
rect = Intl()->CharBounds(aOffset, aCoordType);
} else {
#if defined(XP_WIN)
return NS_ERROR_NOT_IMPLEMENTED;
#else
rect = mIntl.AsProxy()->CharBounds(aOffset, aCoordType);
#endif
}
- *aX = rect.x; *aY = rect.y;
- *aWidth = rect.width; *aHeight = rect.height;
+ rect.GetRect(aX, aY, aWidth, aHeight);
return NS_OK;
}
NS_IMETHODIMP
xpcAccessibleHyperText::GetRangeExtents(int32_t aStartOffset, int32_t aEndOffset,
int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight,
uint32_t aCoordType)
@@ -295,18 +294,17 @@ xpcAccessibleHyperText::GetRangeExtents(
rect = Intl()->TextBounds(aStartOffset, aEndOffset, aCoordType);
} else {
#if defined(XP_WIN)
return NS_ERROR_NOT_IMPLEMENTED;
#else
rect = mIntl.AsProxy()->TextBounds(aStartOffset, aEndOffset, aCoordType);
#endif
}
- *aX = rect.x; *aY = rect.y;
- *aWidth = rect.width; *aHeight = rect.height;
+ rect.GetRect(aX, aY, aWidth, aHeight);
return NS_OK;
}
NS_IMETHODIMP
xpcAccessibleHyperText::GetOffsetAtPoint(int32_t aX, int32_t aY,
uint32_t aCoordType, int32_t* aOffset)
{
NS_ENSURE_ARG_POINTER(aOffset);
--- a/accessible/xul/XULColorPickerAccessible.cpp
+++ b/accessible/xul/XULColorPickerAccessible.cpp
@@ -30,30 +30,30 @@ XULColorPickerTileAccessible::
////////////////////////////////////////////////////////////////////////////////
// XULColorPickerTileAccessible: Accessible
void
XULColorPickerTileAccessible::Value(nsString& aValue)
{
aValue.Truncate();
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
}
role
XULColorPickerTileAccessible::NativeRole()
{
return roles::PUSHBUTTON;
}
uint64_t
XULColorPickerTileAccessible::NativeState()
{
uint64_t state = AccessibleWrap::NativeState();
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::selected))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::selected))
state |= states::SELECTED;
return state;
}
uint64_t
XULColorPickerTileAccessible::NativeInteractiveState() const
{
@@ -133,11 +133,12 @@ XULColorPickerAccessible::AreItemsOperab
// XULColorPickerAccessible: Accessible
bool
XULColorPickerAccessible::IsAcceptableChild(nsIContent* aEl) const
{
nsAutoString role;
nsCoreUtils::XBLBindingRole(aEl, role);
return role.EqualsLiteral("xul:panel") &&
- aEl->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
- nsGkAtoms::_true, eCaseMatters);
+ aEl->IsElement() &&
+ aEl->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
+ nsGkAtoms::_true, eCaseMatters);
}
--- a/accessible/xul/XULComboboxAccessible.cpp
+++ b/accessible/xul/XULComboboxAccessible.cpp
@@ -21,28 +21,29 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// XULComboboxAccessible
////////////////////////////////////////////////////////////////////////////////
XULComboboxAccessible::
XULComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::autocomplete, eIgnoreCase))
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::autocomplete, eIgnoreCase))
mGenericTypes |= eAutoComplete;
else
mGenericTypes |= eCombobox;
// Both the XUL <textbox type="autocomplete"> and <menulist editable="true">
// widgets use XULComboboxAccessible. We need to walk the anonymous children
// for these so that the entry field is a child. Otherwise no XBL children.
if (!mContent->NodeInfo()->Equals(nsGkAtoms::textbox, kNameSpaceID_XUL) &&
- !mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
- nsGkAtoms::_true, eIgnoreCase)) {
+ !mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::editable, nsGkAtoms::_true,
+ eIgnoreCase)) {
mStateFlags |= eNoXBLKids;
}
}
role
XULComboboxAccessible::NativeRole()
{
return IsAutoComplete() ? roles::AUTOCOMPLETE : roles::COMBOBOX;
@@ -150,18 +151,18 @@ XULComboboxAccessible::ActionNameAt(uint
////////////////////////////////////////////////////////////////////////////////
// Widgets
bool
XULComboboxAccessible::IsActiveWidget() const
{
if (IsAutoComplete() ||
- mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
- nsGkAtoms::_true, eIgnoreCase)) {
+ mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
+ nsGkAtoms::_true, eIgnoreCase)) {
int32_t childCount = mChildren.Length();
for (int32_t idx = 0; idx < childCount; idx++) {
Accessible* child = mChildren[idx];
if (child->Role() == roles::ENTRY)
return FocusMgr()->HasDOMFocus(child->GetContent());
}
return false;
}
--- a/accessible/xul/XULElementAccessibles.cpp
+++ b/accessible/xul/XULElementAccessibles.cpp
@@ -179,23 +179,23 @@ XULLinkAccessible::~XULLinkAccessible()
////////////////////////////////////////////////////////////////////////////////
// XULLinkAccessible: Accessible
void
XULLinkAccessible::Value(nsString& aValue)
{
aValue.Truncate();
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, aValue);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::href, aValue);
}
ENameValueFlag
XULLinkAccessible::NativeName(nsString& aName)
{
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
if (!aName.IsEmpty())
return eNameOK;
nsTextEquivUtils::GetNameFromSubtree(this, aName);
return aName.IsEmpty() ? eNameOK : eNameFromSubtree;
}
role
@@ -269,17 +269,17 @@ XULLinkAccessible::EndOffset()
already_AddRefed<nsIURI>
XULLinkAccessible::AnchorURIAt(uint32_t aAnchorIndex)
{
if (aAnchorIndex != 0)
return nullptr;
nsAutoString href;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
nsIDocument* document = mContent->OwnerDoc();
nsCOMPtr<nsIURI> anchorURI;
NS_NewURI(getter_AddRefs(anchorURI), href,
document->GetDocumentCharacterSet(),
baseURI);
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -117,17 +117,17 @@ XULButtonAccessible::NativeState()
}
}
}
}
if (ContainsMenu())
state |= states::HASPOPUP;
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::_default))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::_default))
state |= states::DEFAULT;
return state;
}
////////////////////////////////////////////////////////////////////////////////
// XULButtonAccessible: Widgets
@@ -184,32 +184,32 @@ XULButtonAccessible::IsAcceptableChild(n
// Button type="menu-button" contains a real button. Get an accessible
// for it. Ignore dropmarker button which is placed as a last child.
if ((!role.EqualsLiteral("xul:button") &&
!role.EqualsLiteral("xul:toolbarbutton")) ||
aEl->IsXULElement(nsGkAtoms::dropMarker)) {
return false;
}
- return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::menuButton, eCaseMatters);
+ return mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::menuButton, eCaseMatters);
}
////////////////////////////////////////////////////////////////////////////////
// XULButtonAccessible protected
bool
XULButtonAccessible::ContainsMenu() const
{
- static nsIContent::AttrValuesArray strings[] =
+ static Element::AttrValuesArray strings[] =
{&nsGkAtoms::menu, &nsGkAtoms::menuButton, nullptr};
- return mContent->FindAttrValueIn(kNameSpaceID_None,
- nsGkAtoms::type,
- strings, eCaseMatters) >= 0;
+ return mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
+ nsGkAtoms::type,
+ strings, eCaseMatters) >= 0;
}
////////////////////////////////////////////////////////////////////////////////
// XULDropmarkerAccessible
////////////////////////////////////////////////////////////////////////////////
XULDropmarkerAccessible::
XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
@@ -598,17 +598,17 @@ role
XULToolbarAccessible::NativeRole()
{
return roles::TOOLBAR;
}
ENameValueFlag
XULToolbarAccessible::NativeName(nsString& aName)
{
- if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::toolbarname, aName))
+ if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::toolbarname, aName))
aName.CompressWhitespace();
return eNameOK;
}
////////////////////////////////////////////////////////////////////////////////
// XULToolbarAccessible
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -121,18 +121,18 @@ XULListboxAccessible::NativeState()
// As a XULListboxAccessible we can have the following states:
// FOCUSED, READONLY, FOCUSABLE
// Get focus status from base class
uint64_t states = Accessible::NativeState();
// see if we are multiple select if so set ourselves as such
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::seltype,
- nsGkAtoms::multiple, eCaseMatters)) {
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::seltype,
+ nsGkAtoms::multiple, eCaseMatters)) {
states |= states::MULTISELECTABLE | states::EXTSELECTABLE;
}
return states;
}
/**
* Our value is the label of our ( first ) selected child.
@@ -151,17 +151,17 @@ XULListboxAccessible::Value(nsString& aV
}
}
role
XULListboxAccessible::NativeRole()
{
// A richlistbox is used with the new autocomplete URL bar, and has a parent
// popup <panel>.
- if (mContent->GetParent()->IsXULElement(nsGkAtoms::panel))
+ if (mContent->GetParent() && mContent->GetParent()->IsXULElement(nsGkAtoms::panel))
return roles::COMBOBOX_LIST;
return IsMulticolumn() ? roles::TABLE : roles::LISTBOX;
}
////////////////////////////////////////////////////////////////////////////////
// XULListboxAccessible: Table
@@ -531,20 +531,20 @@ XULListboxAccessible::ContainerWidget()
////////////////////////////////////////////////////////////////////////////////
// XULListitemAccessible
////////////////////////////////////////////////////////////////////////////////
XULListitemAccessible::
XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULMenuitemAccessible(aContent, aDoc)
{
- mIsCheckbox = mContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::type,
- nsGkAtoms::checkbox,
- eCaseMatters);
+ mIsCheckbox = mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::type,
+ nsGkAtoms::checkbox,
+ eCaseMatters);
mType = eXULListItemType;
// Walk XBL anonymous children for list items. Overrides the flag value from
// base XULMenuitemAccessible class.
mStateFlags &= ~eNoXBLKids;
}
XULListitemAccessible::~XULListitemAccessible()
@@ -592,17 +592,17 @@ XULListitemAccessible::Description(nsStr
*/
ENameValueFlag
XULListitemAccessible::NativeName(nsString& aName)
{
nsIContent* childContent = mContent->GetFirstChild();
if (childContent) {
if (childContent->NodeInfo()->Equals(nsGkAtoms::listcell,
kNameSpaceID_XUL)) {
- childContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
+ childContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
return eNameOK;
}
}
return Accessible::NativeName(aName);
}
role
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -47,35 +47,35 @@ XULMenuitemAccessible::
uint64_t
XULMenuitemAccessible::NativeState()
{
uint64_t state = Accessible::NativeState();
// Has Popup?
if (mContent->NodeInfo()->Equals(nsGkAtoms::menu, kNameSpaceID_XUL)) {
state |= states::HASPOPUP;
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::open))
+ if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open))
state |= states::EXPANDED;
else
state |= states::COLLAPSED;
}
// Checkable/checked?
- static nsIContent::AttrValuesArray strings[] =
+ static Element::AttrValuesArray strings[] =
{ &nsGkAtoms::radio, &nsGkAtoms::checkbox, nullptr };
- if (mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings,
- eCaseMatters) >= 0) {
+ if (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
+ strings, eCaseMatters) >= 0) {
// Checkable?
state |= states::CHECKABLE;
// Checked?
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked,
- nsGkAtoms::_true, eCaseMatters))
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked,
+ nsGkAtoms::_true, eCaseMatters))
state |= states::CHECKED;
}
// Combo box listitem
bool isComboboxOption = (Role() == roles::COMBOBOX_OPTION);
if (isComboboxOption) {
// Is selected?
bool isSelected = false;
@@ -132,38 +132,38 @@ XULMenuitemAccessible::NativeInteractive
}
return states::FOCUSABLE | states::SELECTABLE;
}
ENameValueFlag
XULMenuitemAccessible::NativeName(nsString& aName)
{
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
return eNameOK;
}
void
XULMenuitemAccessible::Description(nsString& aDescription)
{
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::description,
- aDescription);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::description,
+ aDescription);
}
KeyBinding
XULMenuitemAccessible::AccessKey() const
{
// Return menu accesskey: N or Alt+F.
static int32_t gMenuAccesskeyModifier = -1; // magic value of -1 indicates unitialized state
// We do not use nsCoreUtils::GetAccesskeyFor() because accesskeys for
// menu are't registered by EventStateManager.
nsAutoString accesskey;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey,
- accesskey);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey,
+ accesskey);
if (accesskey.IsEmpty())
return KeyBinding();
uint32_t modifierKey = 0;
Accessible* parentAcc = Parent();
if (parentAcc) {
if (parentAcc->NativeRole() == roles::MENUBAR) {
@@ -193,35 +193,35 @@ XULMenuitemAccessible::AccessKey() const
return KeyBinding(accesskey[0], modifierKey);
}
KeyBinding
XULMenuitemAccessible::KeyboardShortcut() const
{
nsAutoString keyElmId;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyElmId);
+ mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyElmId);
if (keyElmId.IsEmpty())
return KeyBinding();
- nsIContent* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId);
+ Element* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId);
if (!keyElm)
return KeyBinding();
uint32_t key = 0;
nsAutoString keyStr;
keyElm->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyStr);
if (keyStr.IsEmpty()) {
nsAutoString keyCodeStr;
keyElm->GetAttr(kNameSpaceID_None, nsGkAtoms::keycode, keyCodeStr);
nsresult errorCode;
- key = keyStr.ToInteger(&errorCode, kRadix10);
+ key = keyStr.ToInteger(&errorCode, /* aRadix = */ 10);
if (NS_FAILED(errorCode)) {
- key = keyStr.ToInteger(&errorCode, kRadix16);
+ key = keyStr.ToInteger(&errorCode, /* aRadix = */ 16);
}
} else {
key = keyStr[0];
}
nsAutoString modifiersStr;
keyElm->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, modifiersStr);
@@ -248,23 +248,22 @@ XULMenuitemAccessible::NativeRole()
{
nsCOMPtr<nsIDOMXULContainerElement> xulContainer(do_QueryInterface(mContent));
if (xulContainer)
return roles::PARENT_MENUITEM;
if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
return roles::COMBOBOX_OPTION;
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::radio, eCaseMatters))
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::radio, eCaseMatters))
return roles::RADIO_MENU_ITEM;
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::checkbox,
- eCaseMatters))
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::checkbox, eCaseMatters))
return roles::CHECK_MENU_ITEM;
return roles::MENUITEM;
}
int32_t
XULMenuitemAccessible::GetLevelInternal()
{
@@ -416,23 +415,24 @@ XULMenupopupAccessible::
uint64_t
XULMenupopupAccessible::NativeState()
{
uint64_t state = Accessible::NativeState();
#ifdef DEBUG
// We are onscreen if our parent is active
- bool isActive = mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive);
+ bool isActive =
+ mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive);
if (!isActive) {
Accessible* parent = Parent();
if (parent) {
nsIContent* parentContent = parent->GetContent();
- if (parentContent)
- isActive = parentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::open);
+ if (parentContent && parentContent->IsElement())
+ isActive = parentContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open);
}
}
NS_ASSERTION(isActive || (state & states::INVISIBLE),
"XULMenupopup doesn't have INVISIBLE when it's inactive");
#endif
if (state & states::INVISIBLE)
@@ -441,17 +441,19 @@ XULMenupopupAccessible::NativeState()
return state;
}
ENameValueFlag
XULMenupopupAccessible::NativeName(nsString& aName)
{
nsIContent* content = mContent;
while (content && aName.IsEmpty()) {
- content->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
+ if (content->IsElement()) {
+ content->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
+ }
content = content->GetFlattenedTreeParent();
}
return eNameOK;
}
role
XULMenupopupAccessible::NativeRole()
--- a/accessible/xul/XULSliderAccessible.cpp
+++ b/accessible/xul/XULSliderAccessible.cpp
@@ -49,18 +49,18 @@ XULSliderAccessible::NativeInteractiveSt
}
return 0;
}
bool
XULSliderAccessible::NativelyUnavailable() const
{
- return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
- nsGkAtoms::_true, eCaseMatters);
+ return mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
+ nsGkAtoms::_true, eCaseMatters);
}
void
XULSliderAccessible::Value(nsString& aValue)
{
GetSliderAttr(nsGkAtoms::curpos, aValue);
}
@@ -146,17 +146,17 @@ XULSliderAccessible::GetSliderElement()
nsresult
XULSliderAccessible::GetSliderAttr(nsAtom* aName, nsAString& aValue) const
{
aValue.Truncate();
if (IsDefunct())
return NS_ERROR_FAILURE;
- nsIContent* sliderElm = GetSliderElement();
+ Element* sliderElm = GetSliderElement();
if (sliderElm)
sliderElm->GetAttr(kNameSpaceID_None, aName, aValue);
return NS_OK;
}
nsresult
XULSliderAccessible::SetSliderAttr(nsAtom* aName, const nsAString& aValue)
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -80,18 +80,18 @@ XULTabAccessible::NativeState()
// Check whether the tab is selected and/or pinned
nsCOMPtr<nsIDOMXULSelectControlItemElement> tab(do_QueryInterface(mContent));
if (tab) {
bool selected = false;
if (NS_SUCCEEDED(tab->GetSelected(&selected)) && selected)
state |= states::SELECTED;
- if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::pinned,
- nsGkAtoms::_true, eCaseMatters))
+ if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::pinned,
+ nsGkAtoms::_true, eCaseMatters))
state |= states::PINNED;
}
return state;
}
uint64_t
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -188,18 +188,18 @@ XULTreeAccessible::ChildAtPoint(int32_t
nsPresContext *presContext = frame->PresContext();
nsIPresShell* presShell = presContext->PresShell();
nsIFrame *rootFrame = presShell->GetRootFrame();
NS_ENSURE_TRUE(rootFrame, nullptr);
CSSIntRect rootRect = rootFrame->GetScreenRect();
- int32_t clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.x;
- int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.y;
+ int32_t clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.X();
+ int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.Y();
int32_t row = -1;
nsCOMPtr<nsITreeColumn> column;
nsAutoString childEltUnused;
mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
childEltUnused);
// If we failed to find tree cell for the given point then it might be
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -322,18 +322,18 @@ XULTreeGridRowAccessible::ChildAtPoint(i
nsPresContext *presContext = frame->PresContext();
nsIPresShell* presShell = presContext->PresShell();
nsIFrame *rootFrame = presShell->GetRootFrame();
NS_ENSURE_TRUE(rootFrame, nullptr);
CSSIntRect rootRect = rootFrame->GetScreenRect();
- int32_t clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.x;
- int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.y;
+ int32_t clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.X();
+ int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.Y();
int32_t row = -1;
nsCOMPtr<nsITreeColumn> column;
nsAutoString childEltUnused;
mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
childEltUnused);
// Return if we failed to find tree cell in the row for the given point.
@@ -817,19 +817,19 @@ XULTreeGridCellAccessible::IsEditable()
if (NS_FAILED(rv) || !isEditable)
return false;
nsCOMPtr<nsIDOMElement> columnElm;
mColumn->GetElement(getter_AddRefs(columnElm));
if (!columnElm)
return false;
- nsCOMPtr<nsIContent> columnContent(do_QueryInterface(columnElm));
+ nsCOMPtr<Element> columnContent(do_QueryInterface(columnElm));
if (!columnContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::editable,
nsGkAtoms::_true,
eCaseMatters))
return false;
- return mContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::editable,
- nsGkAtoms::_true, eCaseMatters);
+ return mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+ nsGkAtoms::editable,
+ nsGkAtoms::_true, eCaseMatters);
}
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -48,16 +48,23 @@ ifdef COMPILE_ENVIRONMENT
libs::
cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
endif
GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)
endif
+# channel-prefs.js is handled separate from other prefs due to bug 756325
+# DO NOT change the content of channel-prefs.js without taking the appropriate
+# steps. See bug 1431342.
+libs:: $(srcdir)/profile/channel-prefs.js
+ $(NSINSTALL) -D $(DIST)/bin/defaults/pref
+ $(call py_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
+
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
ifdef MOZ_DEBUG
MAC_APP_NAME := $(MAC_APP_NAME)Debug
endif
@@ -83,18 +90,18 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_
rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(dist_dest)' --exclude English.lproj
rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ '$(dist_dest)/$(LPROJ)'
sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' -e 's/%MAC_BUNDLE_VERSION%/$(MAC_BUNDLE_VERSION)/' -e 's|%MOZ_DEVELOPER_REPO_PATH%|$(topsrcdir)|' -e 's|%MOZ_DEVELOPER_OBJ_PATH%|$(topobjdir)|' $(srcdir)/macbuild/Contents/Info.plist.in > '$(dist_dest)/Contents/Info.plist'
sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(dist_dest)/$(LPROJ)/InfoPlist.strings'
rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(dist_dest)/Contents/Resources'
rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS'
$(RM) '$(dist_dest)/Contents/MacOS/$(MOZ_APP_NAME)'
rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS'
- cp -RL $(DIST)/branding/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns'
- cp -RL $(DIST)/branding/document.icns '$(dist_dest)/Contents/Resources/document.icns'
+ cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns'
+ cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns'
$(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices'
ifdef MOZ_UPDATER
mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
endif
printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo'
endif
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -1,10 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
-<blocklist lastupdate="1512488572398" xmlns="http://www.mozilla.org/2006/addons-blocklist">
+<blocklist lastupdate="1500496563565" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i398" id="{377e5d4d-77e5-476a-8716-7e70a9272da0}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
@@ -257,16 +257,20 @@
</emItem>
<emItem blockID="i862" id="{CA8C84C6-3918-41b1-BE77-049B2BDD887C}">
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
+ <emItem blockID="5bf72f70-a611-4845-af3f-d4dabe8862b6" id="/^(\{1490068c-d8b7-4bd2-9621-a648942b312c\})|(\{d47ebc8a-c1ea-4a42-9ca3-f723fff034bd\})|(\{83d6f65c-7fc0-47d0-9864-a488bfcaa376\})|(\{e804fa4c-08e0-4dae-a237-8680074eba07\})|(\{ea618d26-780e-4f0f-91fd-2a6911064204\})|(\{ce93dcc7-f911-4098-8238-7f023dcdfd0d\})|(\{7eaf96aa-d4e7-41b0-9f12-775c2ac7f7c0\})|(\{b019c485-2a48-4f5b-be13-a7af94bc1a3e\})|(\{9b8a3057-8bf4-4a9e-b94b-867e4e71a50c\})|(\{eb3ebb14-6ced-4f60-9800-85c3de3680a4\})|(\{01f409a5-d617-47be-a574-d54325fe05d1\})$/">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="i882" id="69ffxtbr@PackageTracer_69.com">
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i706" id="thefoxonlybetter@quicksaver">
@@ -956,68 +960,36 @@
<emItem blockID="i598" id="{29b136c9-938d-4d3d-8df8-d649d9b74d02}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i108" id="{28bfb930-7620-11e1-b0c4-0800200c9a66}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
- <emItem blockID="i13" id="{E8E88AB0-7182-11DF-904E-6045E0D72085}">
- <prefs/>
- <versionRange minVersion="0" maxVersion="*" severity="3"/>
- </emItem>
<emItem blockID="i226" id="{462be121-2b54-4218-bf00-b9bf8135b23f}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
- <emItem blockID="i117" id="{ce7e73df-6a44-4028-8079-5927a588c948}">
- <prefs/>
- <versionRange minVersion="0" maxVersion="1.0.8" severity="1"/>
- </emItem>
<emItem blockID="i44" id="sigma@labs.mozilla">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
- <emItem blockID="i258" id="helperbar@helperbar.com">
- <prefs/>
- <versionRange minVersion="0" maxVersion="1.0" severity="1"/>
- </emItem>
<emItem blockID="i96" id="youtubeee@youtuber3.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
- <emItem blockID="i564" id="/^(firefox@vebergreat\.net|EFGLQA@78ETGYN-0W7FN789T87\.COM)$/">
- <prefs/>
- <versionRange minVersion="0" maxVersion="*" severity="1"/>
- </emItem>
- <emItem blockID="i500" id="{2aab351c-ad56-444c-b935-38bffe18ad26}">
- <prefs/>
- <versionRange minVersion="0" maxVersion="*" severity="3"/>
- </emItem>
<emItem blockID="i97" id="support3_en@adobe122.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
- <emItem blockID="i439" id="{d2cf9842-af95-48cd-b873-bfbb48cd7f5e}">
- <prefs/>
- <versionRange minVersion="0" maxVersion="*" severity="1"/>
- </emItem>
<emItem blockID="i576" id="newmoz@facebook.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
- <emItem blockID="i46" id="{841468a1-d7f4-4bd3-84e6-bb0f13a06c64}">
- <prefs/>
- <versionRange minVersion="0.1" maxVersion="*" severity="1">
- <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
- <versionRange maxVersion="9.0" minVersion="9.0a1"/>
- </targetApplication>
- </versionRange>
- </emItem>
<emItem blockID="i776" id="g@uzcERQ6ko.net">
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i494" id="/^({e9df9360-97f8-4690-afe6-996c80790da4}|{687578b9-7132-4a7a-80e4-30ee31099e03}|{46a3135d-3683-48cf-b94c-82655cbc0e8a}|{49c795c2-604a-4d18-aeb1-b3eba27e5ea2}|{7473b6bd-4691-4744-a82b-7854eb3d70b6}|{96f454ea-9d38-474f-b504-56193e00c1a5})$/">
@@ -1069,16 +1041,20 @@
</targetApplication>
</versionRange>
<versionRange minVersion="1.5.7.5" maxVersion="1.5.7.5" severity="1"/>
</emItem>
<emItem blockID="i515" id="/^({bf9194c2-b86d-4ebc-9b53-1c08b6ff779e}|{61a83e16-7198-49c6-8874-3e4e8faeb4f3}|{f0af464e-5167-45cf-9cf0-66b396d1918c}|{5d9968c3-101c-4944-ba71-72d77393322d}|{01e86e69-a2f8-48a0-b068-83869bdba3d0})$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
+ <emItem blockID="4ca8206f-bc2a-4428-9439-7f3142dc08db" id="/^(\{ac06c6b2-3fd6-45ee-9237-6235aa347215\})|(\{d461cc1b-8a36-4ff0-b330-1824c148f326\})|(\{d1ab5ebd-9505-481d-a6cd-6b9db8d65977\})|(\{07953f60-447e-4f53-a5ef-ed060487f616\})|(\{2d3c5a5a-8e6f-4762-8aff-b24953fe1cc9\})|(\{f82b3ad5-e590-4286-891f-05adf5028d2f\})|(\{f96245ad-3bb0-46c5-8ca9-2917d69aa6ca\})|(\{2f53e091-4b16-4b60-9cae-69d0c55b2e78\})|(\{18868c3a-a209-41a6-855d-f99f782d1606\})|(\{47352fbf-80d9-4b70-9398-fb7bffa3da53\})$/">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="i596" id="{b99c8534-7800-48fa-bd71-519a46cdc7e1}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i461" id="{8E9E3331-D360-4f87-8803-52DE43566502}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
@@ -1265,16 +1241,20 @@
<versionRange maxVersion="*" minVersion="56.0a1"/>
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i1034" id="a88a77ahjjfjakckmmabsy278djasi@jetpack">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
+ <emItem blockID="8088b39a-3e6d-4a17-a22f-3f95c0464bd6" id="{5b0f6d3c-10fd-414c-a135-dffd26d7de0f}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="9abc7502-bd6f-40d7-b035-abe721345360" id="{368eb817-31b4-4be9-a761-b67598faf9fa}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i562" id="iobitapps@mybrowserbar.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
@@ -1467,16 +1447,20 @@
<emItem blockID="i68" id="flashupdate@adobe.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i492" id="{af95cc15-3b9b-45ae-8d9b-98d08eda3111}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
+ <emItem blockID="674b6e19-f087-4706-a91d-1e723ed6f79e" id="{1490068c-d8b7-4bd2-9621-a648942b312c}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="i488" id="jid1-4P0kohSJxU1qGg@jetpack">
<prefs/>
<versionRange minVersion="1.2.50" maxVersion="1.2.50" severity="1"/>
</emItem>
<emItem blockID="i314" id="crossriderapp8812@crossrider.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
@@ -1515,16 +1499,20 @@
<emItem blockID="i852" id="6lIy@T.edu">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i856" id="/^({94d62e35-4b43-494c-bf52-ba5935df36ef}|firefox@advanceelite\.com|{bb7b7a60-f574-47c2-8a0b-4c56f2da9802})$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
+ <emItem blockID="9dfeee42-e6a8-49e0-8979-0648f7368239" id="/^({fce89242-66d3-4946-9ed0-e66078f172fc})|({0c4df994-4f4a-4646-ae5d-8936be8a4188})|({6cee30bc-a27c-43ea-ac72-302862db62b2})|({e08ebf0b-431d-4ed1-88bb-02e5db8b9443})$/">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="i520" id="/^({7316e43a-3ebd-4bb4-95c1-9caf6756c97f}|{0cc09160-108c-4759-bab1-5c12c216e005}|{ef03e721-f564-4333-a331-d4062cee6f2b}|{465fcfbb-47a4-4866-a5d5-d12f9a77da00}|{7557724b-30a9-42a4-98eb-77fcb0fd1be3}|{b7c7d4b0-7a84-4b73-a7ef-48ef59a52c3b})$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="f7569261-f575-4719-8202-552b20d013b0" id="{7e907a15-0a4c-4ff4-b64f-5eeb8f841349}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@@ -1808,16 +1796,20 @@
<emItem blockID="i472" id="linksicle@linksicle.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="0a47a2f7-f07c-489b-bd39-88122a2dfe6a" id="@DA3566E2-F709-11E5-8E87-A604BC8E7F8B">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
+ <emItem blockID="455772a3-8360-4f5a-9a5f-a45b904d0b51" id="{dfa727cb-0246-4c5a-843a-e4a8592cc7b9}">
+ <prefs/>
+ <versionRange minVersion="2.0.0" maxVersion="2.0.0" severity="1"/>
+ </emItem>
<emItem blockID="i98" id="youtubeeing@youtuberie.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1213" id="unblocker20__web@unblocker.yt">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
@@ -2074,16 +2066,20 @@
</emItem>
<emItem blockID="i630" id="webbooster@iminent.com">
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
+ <emItem blockID="10d9ce89-b8d4-4b53-b3d7-ecd192681f4e" id="{d03b6b0f-4d44-4666-a6d6-f16ad9483593}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="i842" id="{746505DC-0E21-4667-97F8-72EA6BCF5EEF}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i868" id="{6e7f6f9f-8ce6-4611-add2-05f0f7049ee6}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
@@ -2138,16 +2134,48 @@
<emItem blockID="i350" id="sqlmoz@facebook.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i446" id="{E90FA778-C2B7-41D0-9FA9-3FEC1CA54D66}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
+ <emItem blockID="i13" id="{E8E88AB0-7182-11DF-904E-6045E0D72085}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
+ <emItem blockID="i117" id="{ce7e73df-6a44-4028-8079-5927a588c948}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="1.0.8" severity="1"/>
+ </emItem>
+ <emItem blockID="i258" id="helperbar@helperbar.com">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="1.0" severity="1"/>
+ </emItem>
+ <emItem blockID="i564" id="/^(firefox@vebergreat\.net|EFGLQA@78ETGYN-0W7FN789T87\.COM)$/">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="1"/>
+ </emItem>
+ <emItem blockID="i500" id="{2aab351c-ad56-444c-b935-38bffe18ad26}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
+ <emItem blockID="i439" id="{d2cf9842-af95-48cd-b873-bfbb48cd7f5e}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="1"/>
+ </emItem>
+ <emItem blockID="i46" id="{841468a1-d7f4-4bd3-84e6-bb0f13a06c64}">
+ <prefs/>
+ <versionRange minVersion="0.1" maxVersion="*" severity="1">
+ <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
+ <versionRange maxVersion="9.0" minVersion="9.0a1"/>
+ </targetApplication>
+ </versionRange>
+ </emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p416">
<match exp="JavaAppletPlugin\.plugin" name="filename"/>
<versionRange maxVersion="Java 6 Update 45" minVersion="Java 6 Update 42" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange maxVersion="*" minVersion="17.0"/>
</targetApplication>
@@ -3414,52 +3442,40 @@
<serialNumber>Gd/pPu+qLnXUdvP9sW73CQ==</serialNumber>
</certItem>
<certItem issuerName="MFoxCzAJBgNVBAYTAkRFMRMwEQYDVQQKEwpERk4tVmVyZWluMRAwDgYDVQQLEwdERk4tUEtJMSQwIgYDVQQDExtERk4tVmVyZWluIFBDQSBHbG9iYWwgLSBHMDE=">
<serialNumber>F5Bg6C237Q==</serialNumber>
</certItem>
<certItem issuerName="MIG9MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5">
<serialNumber>Ai7cBJYqBE0I9NdyoZfRrw==</serialNumber>
</certItem>
- <certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBFQ0MgUm9vdCAtIEcx">
- <serialNumber>KNhgX8XuJduYciIyatpOQg==</serialNumber>
- </certItem>
<certItem issuerName="MIGLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMRUwEwYDVQQLEwxNaWNyb3NvZnQgSVQxHjAcBgNVBAMTFU1pY3Jvc29mdCBJVCBTU0wgU0hBMg==">
<serialNumber>WgAFElcDxFjoswSzjAABAAUSVw==</serialNumber>
</certItem>
- <certItem issuerName="MHExCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNEZXV0c2NoZSBUZWxla29tIEFHMR8wHQYDVQQLExZULVRlbGVTZWMgVHJ1c3QgQ2VudGVyMSMwIQYDVQQDExpEZXV0c2NoZSBUZWxla29tIFJvb3QgQ0EgMg==">
- <serialNumber>AImQERVYPoeb</serialNumber>
- </certItem>
- <certItem issuerName="MGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAy">
- <serialNumber>GpO48aJ8GngtwECqZhm/xA==</serialNumber>
- </certItem>
- <certItem issuerName="MDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBDQTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUw=">
- <serialNumber>CdYL9vSQCEKzBwjO10ud2w==</serialNumber>
- </certItem>
<certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBFQ0MgUm9vdCAtIEcx">
<serialNumber>UKM/CNF2OvC4giYnAUG/Ag==</serialNumber>
</certItem>
<certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBSU0EgUm9vdCAtIEcx">
<serialNumber>LzVYePklc3vH3jkk0BZr9g==</serialNumber>
</certItem>
<certItem issuerName="MIG9MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5">
<serialNumber>BYOGvG32ukb1Yxj2oKoFyw==</serialNumber>
</certItem>
- <certItem issuerName="MDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMCREU=">
- <serialNumber>a12RvBNhznU=</serialNumber>
- </certItem>
<certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBSU0EgUm9vdCAtIEcx">
<serialNumber>P4sUnc++hlU/bXj0zSTlcQ==</serialNumber>
</certItem>
<certItem issuerName="MIGFMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDErMCkGA1UEAxMiQ09NT0RPIFJTQSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eQ==">
<serialNumber>AKrMYlJmUUin8FOM/0TJrmk=</serialNumber>
</certItem>
<certItem issuerName="MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQDExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMw==">
<serialNumber>A7uy+rmTav6tDH4dRrsnvXGH</serialNumber>
</certItem>
+ <certItem issuerName="MFQxCzAJBgNVBAYTAkJNMRkwFwYDVQQKDBBRdW9WYWRpcyBMaW1pdGVkMSowKAYDVQQDDCFRdW9WYWRpcyBFbnRlcnByaXNlIFRydXN0IENBIDIgRzM=">
+ <serialNumber>bqapwACCtKhVagTl7cEP7KFbM0E=</serialNumber>
+ </certItem>
<certItem issuerName="MEQxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMR0wGwYDVQQDExRHZW9UcnVzdCBTU0wgQ0EgLSBHMw==">
<serialNumber>RUT1Gehd1KKYPfqOlgspoQ==</serialNumber>
</certItem>
<certItem issuerName="MHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWU=">
<serialNumber>KuzHPJLdK5hNgJRo3R47Ag==</serialNumber>
</certItem>
<certItem issuerName="MGsxCzAJBgNVBAYTAklUMQ4wDAYDVQQHDAVNaWxhbjEjMCEGA1UECgwaQWN0YWxpcyBTLnAuQS4vMDMzNTg1MjA5NjcxJzAlBgNVBAMMHkFjdGFsaXMgQXV0aGVudGljYXRpb24gUm9vdCBDQQ==">
<serialNumber>WJ2qHzWUqTk=</serialNumber>
@@ -3477,16 +3493,19 @@
<serialNumber>OOkLFZaa4CXGyJlLTIEjUQ==</serialNumber>
</certItem>
<certItem issuerName="MFoxCzAJBgNVBAYTAklFMRIwEAYDVQQKEwlCYWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxIjAgBgNVBAMTGUJhbHRpbW9yZSBDeWJlclRydXN0IFJvb3Q=">
<serialNumber>Byc85g==</serialNumber>
</certItem>
<certItem issuerName="MEwxIDAeBgNVBAsTF0dsb2JhbFNpZ24gUm9vdCBDQSAtIFIyMRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu">
<serialNumber>BAAAAAABRE7wRk4=</serialNumber>
</certItem>
+ <certItem issuerName="MFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQKDBBWZXJpem9uIEJ1c2luZXNzMREwDwYDVQQLDAhPbW5pUm9vdDEfMB0GA1UEAwwWVmVyaXpvbiBHbG9iYWwgUm9vdCBDQQ==">
+ <serialNumber>BFA=</serialNumber>
+ </certItem>
<certItem issuerName="MFoxCzAJBgNVBAYTAklFMRIwEAYDVQQKEwlCYWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxIjAgBgNVBAMTGUJhbHRpbW9yZSBDeWJlclRydXN0IFJvb3Q=">
<serialNumber>ByeQ9g==</serialNumber>
</certItem>
<certItem issuerName="MFwxCzAJBgNVBAYTAkJFMRUwEwYDVQQLEwxUcnVzdGVkIFJvb3QxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExGzAZBgNVBAMTElRydXN0ZWQgUm9vdCBDQSBHMg==">
<serialNumber>OYBKgxEHpW/8XGAGAlvJyMA=</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>bzTw0uq05TUYEGS98bh0Ww==</serialNumber>
@@ -3816,16 +3835,19 @@
<serialNumber>GN2Hrh9LtnE=</serialNumber>
</certItem>
<certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBFQ0MgUm9vdCAtIEcx">
<serialNumber>UT6GtTGbEC6SXJteWAKy2g==</serialNumber>
</certItem>
<certItem issuerName="MGYxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMR0wGwYDVQQLExREb21haW4gVmFsaWRhdGVkIFNTTDEgMB4GA1UEAxMXR2VvVHJ1c3QgRFYgU1NMIENBIC0gRzI=">
<serialNumber>P6G7IYSL2RZxtzTh8I6qPA==</serialNumber>
</certItem>
+ <certItem issuerName="MIGSMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE4MDYGA1UEAxMvQ09NT0RPIFJTQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIgQ0E=">
+ <serialNumber>TasC8Zd8BT8kXEE67cFQmA==</serialNumber>
+ </certItem>
<certItem issuerName="MGcxCzAJBgNVBAYTAkRFMRMwEQYDVQQKEwpGcmF1bmhvZmVyMSEwHwYDVQQLExhGcmF1bmhvZmVyIENvcnBvcmF0ZSBQS0kxIDAeBgNVBAMTF0ZyYXVuaG9mZXIgUm9vdCBDQSAyMDA3">
<serialNumber>YR3YYQAAAAAABA==</serialNumber>
</certItem>
<certItem issuerName="MIGVMQswCQYDVQQGEwJHUjFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTE=">
<serialNumber>GN2Hrh9LtnQ=</serialNumber>
</certItem>
<certItem issuerName="MFoxCzAJBgNVBAYTAklFMRIwEAYDVQQKEwlCYWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxIjAgBgNVBAMTGUJhbHRpbW9yZSBDeWJlclRydXN0IFJvb3Q=">
<serialNumber>ByfNeA==</serialNumber>
@@ -3891,16 +3913,19 @@
<serialNumber>CuUEKEJM4xhxlFXraPcSpQ==</serialNumber>
</certItem>
<certItem issuerName="MD8xJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEXMBUGA1UEAxMORFNUIFJvb3QgQ0EgWDM=">
<serialNumber>CgFBQQAAATjkOB1sAAAAAg==</serialNumber>
</certItem>
<certItem issuerName="MIG9MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5">
<serialNumber>QOu0a5Z9rCkw6Nk7Rg1/AQ==</serialNumber>
</certItem>
+ <certItem issuerName="MFoxCzAJBgNVBAYTAklFMRIwEAYDVQQKEwlCYWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxIjAgBgNVBAMTGUJhbHRpbW9yZSBDeWJlclRydXN0IFJvb3Q=">
+ <serialNumber>ByfNbw==</serialNumber>
+ </certItem>
<certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBSU0EgUm9vdCAtIEcx">
<serialNumber>ElBUYv/f+6+gnbAJ23qnAA==</serialNumber>
</certItem>
<certItem issuerName="MIGVMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTEdMBsGA1UEAxMUVVROLVVTRVJGaXJzdC1PYmplY3Q=">
<serialNumber>a9rf7/BmG9JkKvRuy7J5QA==</serialNumber>
</certItem>
<certItem issuerName="MFwxCzAJBgNVBAYTAkJFMRUwEwYDVQQLEwxUcnVzdGVkIFJvb3QxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExGzAZBgNVBAMTElRydXN0ZWQgUm9vdCBDQSBHMg==">
<serialNumber>QM1zZ4GZ4gfwpQtUYye3Ne0=</serialNumber>
@@ -4143,16 +4168,19 @@
<serialNumber>ByemaQ==</serialNumber>
</certItem>
<certItem issuerName="MD8xCzAJBgNVBAYTAlRXMTAwLgYDVQQKDCdHb3Zlcm5tZW50IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHk=">
<serialNumber>K1ftto7Xcb0YKwQ6uMvOIA==</serialNumber>
</certItem>
<certItem issuerName="MEUxCzAJBgNVBAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzI=">
<serialNumber>AIZ6Wq/4deFQzwC6NnFpUA==</serialNumber>
</certItem>
+ <certItem issuerName="MIG0MQswCQYDVQQGEwJVUzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWRkeS5jb20sIEluYy4xLTArBgNVBAsTJGh0dHA6Ly9jZXJ0cy5nb2RhZGR5LmNvbS9yZXBvc2l0b3J5LzEzMDEGA1UEAxMqR28gRGFkZHkgU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcy">
+ <serialNumber>AOfHzdPzlvw5</serialNumber>
+ </certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>BA==</serialNumber>
</certItem>
<certItem issuerName="MF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5">
<serialNumber>L7tgs/W85vnhV7I7qJ6N/g==</serialNumber>
</certItem>
<certItem issuerName="MH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5">
<serialNumber>Qh/SqA==</serialNumber>
@@ -4413,16 +4441,19 @@
<serialNumber>JD1wxDd8IgmiqX7MyPPg1g==</serialNumber>
</certItem>
<certItem issuerName="MDsxGDAWBgNVBAoTD0N5YmVydHJ1c3QsIEluYzEfMB0GA1UEAxMWQ3liZXJ0cnVzdCBHbG9iYWwgUm9vdA==">
<serialNumber>BAAAAAABQaHhNLo=</serialNumber>
</certItem>
<certItem issuerName="MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQDExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMw==">
<serialNumber>AwBGo0Zmp6KRryAguuMvXATI</serialNumber>
</certItem>
+ <certItem issuerName="MHIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJUWDEQMA4GA1UEBxMHSG91c3RvbjEVMBMGA1UEChMMY1BhbmVsLCBJbmMuMS0wKwYDVQQDEyRjUGFuZWwsIEluYy4gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHk=">
+ <serialNumber>AJk3QFH13eHUHHVnsvwS0Vo=</serialNumber>
+ </certItem>
<certItem issuerName="MG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3Q=">
<serialNumber>U3t2Vk8pfxTcaUPpIq0seQ==</serialNumber>
</certItem>
<certItem issuerName="MEQxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMR0wGwYDVQQDExRHZW9UcnVzdCBTU0wgQ0EgLSBHMw==">
<serialNumber>bx/XHJqcwxDOptxJ2lh5vw==</serialNumber>
</certItem>
<certItem issuerName="MHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWU=">
<serialNumber>LU4d0t7PAsZNgJGZcb+o/w==</serialNumber>
@@ -4584,16 +4615,19 @@
<serialNumber>Fw==</serialNumber>
</certItem>
<certItem issuerName="MHYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEnMCUGA1UEAxMeU3ltYW50ZWMgV2ViIFBLSSBFQ0MgUm9vdCAtIEcx">
<serialNumber>Gz4uHrL2usrTZrPCHeuF5g==</serialNumber>
</certItem>
<certItem issuerName="MIHKMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA2IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHNQ==">
<serialNumber>UWMOvf4tj/x5cQN2PXVSww==</serialNumber>
</certItem>
+ <certItem issuerName="MHIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJUWDEQMA4GA1UEBxMHSG91c3RvbjEVMBMGA1UEChMMY1BhbmVsLCBJbmMuMS0wKwYDVQQDEyRjUGFuZWwsIEluYy4gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHk=">
+ <serialNumber>NlLRZJFLco/An3cLAGjGgQ==</serialNumber>
+ </certItem>
<certItem issuerName="MFwxCzAJBgNVBAYTAkJFMRUwEwYDVQQLEwxUcnVzdGVkIFJvb3QxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExGzAZBgNVBAMTElRydXN0ZWQgUm9vdCBDQSBHMg==">
<serialNumber>e/fIfg2Dj2tkYIWVu2r82Cc=</serialNumber>
</certItem>
<certItem issuerName="MH4xCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEvMC0GA1UEAxMmU3ltYW50ZWMgQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzQ=">
<serialNumber>UMUwXwT1Z4juyQ/CNTf4mw==</serialNumber>
</certItem>
<certItem issuerName="MH4xCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEfMB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazEvMC0GA1UEAxMmU3ltYW50ZWMgQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzQ=">
<serialNumber>d8AtKymQwkOPDBj+hjPzFg==</serialNumber>
@@ -4740,16 +4774,19 @@
<serialNumber>ESDu2nhlLPzfx+LYgjlYFP/k</serialNumber>
</certItem>