import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1148708: Add missing 'override' annotations in DocAccessibleChild.h. rs=ehsan (d606358545)
- Bug 1210408 - make nsMaiInterfaceAction work with proxies, r=tbsaunde (f7c819c6ae)
- Bug 1210407 - teach nsMaiInterfaceTable to use proxies, r=tbsaunde (4ca4f10b5f)
- bug 1185157 make sure we don't send an event to a destroyed ipc document r=billm (23acf53f75)
- bug 1214864 - make SetCarretOffset() async r=davidb (e3079e9b2d)
- missing of Bug 1139972 - IPC Proxy for charAt, r=tbsaunde (e9593ed752)
- bug 1191598 - Pass MOZ_CURRENT_PROJECT in environment when running post-build automation steps for universal mac builds. r=gps (fc342c6ced)
- Bug 1164596 - Add mach android-emulator command; r=ahal (afeb9b27d1)
- Bug 1223149 - Add basic usage documentation for mach build; r=glandium (bfb802d175)
- Bug 1182301 - Improve 'mach build' notifications. r=gps (2c65a122d1)
- Bug 1184696 - Add clobber targets to |mach clobber|; Ability to clobber compiled python files, r=gps (35d8be292e)
- Bug 1117958 - Allow any debugging options to the run or gtest mach subcommands to automatically enable debugging. r=gps (32f986af4b)
- Bug 1180081 - Properly rebuild gtest/libxul before running gtests. r=gps (80db9a3d49)
- Bug 1171647, part 1 - Define a new function to convert the mode to a string. r=njn (61ad16f5ba)
- Bug 1171647, part 2 - Remove redundant assertion for dark matter mode. r=njn (b5ac9519f3)
- Bug 1058178, part 1 - Implement DMD heap scanning mode. r=njn (60e1079536)
- Bug 1058178, part 2 - Implement address clamping analysis for DMD scan logs. r=njn (45c0326b93)
- Bug 1102388 - Fix DMD static constructor ordering dependency. r=mccr8 (59b87897a1)
- Bug 1128705 - Don't redefine PAGE_SIZE in DMD if it's already defined. r=erahm (49216348ee)
- Bug 1179042 - Add a script for analyzing memory blocks using a heap scan DMD log. r=njn DONTBUILD (1c08d2d66e)
- Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat (1c999d139b)
- Bug 1158772 - fix non-idiomatic memset call in nsDeque.cpp; r=erahm (de6b555245)
- Bug 1199400 - Part 1: Use CheckedInt when growing nsDeque capacity. r=froydnj (dfdf6814a3)
- Bug 1199400 - Part 0: Remove unused nsDequeIterator. r=froydnj (38d69d7f47)
- Bug 1199400 - Part 2: Add tests for possible nsDeque corner cases. r=froydnj (931baff195)
- Bug 1201997 - Part 1 - Converted compiled test to gtest for nsDeque class. Added tests to test untested methods. r=froydn (e893916651)
- Bug 1201997 - Part 2 - Removing unused methods from the nsDeque class. r=froydn (41595a90ac)
- Bug 1201997 - Part 3 - Make internally used methods private. r=froydn (8cd3afd96f)
- Bug 1201997 - Part 4 - Change size and offset variables to size_t.r=froydn (73eabc8d60)
- Bug 1215140 P1 Add an nsIConsoleReportCollector interface to support navigation channel logging. r=bz (8a41535e2b)
- Bug 1215140 P2 Make HttpBaseChannel implement nsIConsoleReportCollector. r=bz (75fca301f2)
- Bug 1197679 - If nsUnknownDecoder is involved in e10s DivertToParent can break. r=jduell (5d94a12504)
- Bug 1178991 - smartptr for http converter r=hurley (8e7fbc8443)
- bug 366559 - patch 2, fix nsHTTPCompressConv indentation r=bagder (ba762da587)
- bug 366559 - patch 3, fix nsHTTPCompressConv bracing style r=bagder (54195ab451)
- bits of  bug 366559 - patch 7, content-encoding brotli for http (f0b4051022)
- Bug 1205112 - Make PushEvent.data nullable. r=mt,smaug (775db32856)
- Bug 1193414 - SharedWorkers thread should be kept alive also when the SharedWorker object is CCed, r=khuey (b77ea8125c)
- Bug 1206520: Add about:config prefs to enable throwing on asm.js validation failures; r=bz (c42126665d)
- Bug 1193414 - Telemetry for SharedWorker spawning. r=bkelly (77984b7bcc)
- Bug 1205676 - Enable WPT service-worker/unregister-then-register-new-script.https.html in e10s, r=nsm (ec24939cf6)
- Bug 1193133 - Throw when calling postMessage from a Service Worker dom object with no global. r=bkelly (526dcacfab)
- Bug 1181871 P1 Only enforce Cache Context shared data destruction on target thread after init. r=ehsan (cdbf3ed3a8)
- Bug 1181871 P2 Fix ServiceWorkerManager usage of stack-based ErrorResult. r=ehsan (c449195d90)
- minor cleanup and missing bit of 1198230 (02f459db05)
- Bug 1143717 - Implement the ServiceWorkerMessageEvent interface. r=baku (027b3465f2)
- fix misspatch (708eee4e84)
- Bug 1188545 - Disentangle service workers from shared workers and refactor event dispatching code into a separate class. r=nsm,mrbkap (fb5b5341c9)
- Bug 1205228 - Change PackagedAppVerifier to notify the verification result asynchronously. r=valentin. (9edda0fa00)
- Bug 1178518 - Packaged App Utils. r=valentin (f60f3b7a93)
- Bug 1213150 - Part 1: Add a nsContentUtils::IsNonSubresourceRequest helper; r=jdm (b509cc3cc9)
- Bug 1213150 - Part 2: Rework ShouldPrepareForIntercept() in terms of subresource requests; r=jdm (2e92fe8780)
- Bug 1213150 - Part 3: Remove nsIInterceptedChannel.isNavigation; r=jdm (becf1cc12f)
- Bug 1213150 follow-up: fix build bustage (8d73d6ca73)
- Bug 1198394 - Part 1: Allow interception of HSTS upgraded connections in non-e10s mode; r=mcmanus (f504c5be08)
- Bug 1198394 - Part 2: Add a test for interception of HSTS upgraded connections; r=jdm (054e984eef)
- Bug 1187011 - Don't allow response body with null body status. r=bkelly (b1860741d1)
- missing bit of 1140788 (29d319712e)
- Bug 1213436 - Reject core dumps with node IDs that don't fit in an IEEE 754 double; r=sfink (3c1f6fdda0)
- Bug 1211006 - Add Debugger.Source.prototype.canonicalId; r=ejpbruel (eef7b79fce)
- Bug 1199218 - Implement JS::ubi::Node::size for js::LazyScript referents; r=sfink (098a48d240)
- Bug 1220031 - Add JS::ubi::Node::scriptFilename; r=sfink (6b824ae680)
- Bug 1143575. Remove unused MediaQueue::Empty. r=cpearce (de737f3433)
- Bug 1209933 - Make sure all parent runtime pointers are the topmost parent, r=billm. (fe824d967d)
- Bug 1197012 - Fix ThrowTypeError in Notification. r=mccr8 (0b1a097526)
- Bug 1197893 - Check the number of arguments for ThrowTypeError() and ThrowRangeError() at compile time. r=peterv (d98c7d78a0)
- Bug 1142083 - Add test for IDN Unicode domain redirect. r=mcmanus (0c8961fe17)
- Bug 1187159 - Add mochitest for loading packaged apps (iframe+fetch+mozapp) r=jduell (ce90ea561b)
- Bug 1186290 - Notify TabParent to switch process when loading a signed package. r=honzab, r=kanru. (c58a14554a)
- fix (15e2df75eb)
- Bug 1206124 P1 Fix "same-origin" CORS credentials in FetchDriver. r=ehsan (fae1bb6ab3)
- Bug 1206124 P2 Test fetch() with credentials and redirects. r=ehsan (ffc6254112)
- Bug 1211751: Remove nsIChannelEventSink-forwarding from EventSource and FetchDriver. It's never needed. r=smaug (adafe5737a)
- Bug 1212433 Fail fetch() calls that require preflight and also redirect. r=sicking a=abillings (c0d6742b9e)
- Bug 1193128 - Fix base64 decoding when fetching data URIs. r=baku (80bafa291a)
- Bug 1195167 part 1: Let necko handle all protocols. r=bkelly (bb932b0ada)
- Bug 1195167 part 2: Remove redundant aCORSFlag argument and instead use mCORSFlagEverSet. r=bkelly (beadafcad0)
- Bug 1195167 part 3: Remove more scheme-specific handling from FetchDriver. r=bkelly (d00b38db9e)
- Bug 1195167 part 4: Remove FetchDriver::BasicFetch since it is empty. r=bkelly (c5ed097267)
- Bug 1210413 P2 Test CORS credentials on cross-origin redirects. r=sicking a=dveditz (b4eeb8aac0)
- Bug 1210413 P1 Propagate new channel load flags from child to parent on redirect. r=jduell a=dveditz (8b329af4fa)
- Bug 1195167 part 5: Make FetchDriver use AsyncOpen2. r=bkelly (cc217c4cc1)
- Bug 1195167 part 6: Some code simplification since necko handles fetch recursion. r=bkelly (f3b6da2262)
- Bug 1195167: Followup to fix test which I forgot to change (81e7439a2e)
- Bug 1215746: Remove RequestMode::Cors_with_forced_preflight. r=bkelly (0336e812b6)
- Bug 1211000: Move CORS preflight logic from nsCORSListenerProxy to nsCORSPreflightListener. r=ehsan (bf2f71cf22)
- missing bit of Bug 1211443 - Drop scheduled update if decoder initialization isn't done yet. r=jya (f6bc074e33)
- Bug 1182571: Fix nsILoadInfo->GetContentPolicyType API to be less ambigious. Audit and fix all users of it. r=ckerschb (5af6fa7442)
- fix (e40c8e7625)
- Bug 1173811 - Part 1: Propagate the response URL to intercepted channels when necessary (non-e10s). r=mayhemer,bkelly (26f4f13c28)
- Bug 1173811 - Part 2: Propagate the response URL to intercepted channels when necessary (e10s). r=mayhemer,bkelly (a603fe1df2)
- Bug 1154309 - Add New Resource Timing Fields r=bz,hurley (1d14eb6bef)
- Bug 1175685 - add OriginAttribute to LoadInfo. r=jonas, r=ckerschb, r=michal (a5d18bb637)
- Bug 1175685 - add OriginAttribute to LoadInfo. r=jonas, r=ckerschb, r=michal (fb07d2c8aa)
- Bug 1212904 P1 Add a LoadTainting enumeration. r=jduell (a1db8a3e99)
- Bug 1212904 P2 Add LoadTainting information to nsILoadInfo. r=jduell (2482e5e334)
- Bug 1221151 - use [infallible] in nsILoadInfo.idl instead of manual %{C++ blocks; r=jduell (aae73129b6)
- Bug 1045891 - CSP 2 child-src implementation r=ckerschb (792920aeb9)
- Bug 1219931 - CSP: Don't allow removing a policy (r=sicking) (9daaab4186)
- Bug 1208661 - Dump client-side layer textures. r=BenWa (1f2d17d515)
This commit is contained in:
2022-10-17 11:08:37 +08:00
parent 5e37efec1a
commit 8a0a002cf2
2987 changed files with 24310 additions and 19152 deletions
+117
View File
@@ -14,6 +14,8 @@
#include "OuterDocAccessible.h"
#include "ProxyAccessible.h"
#include "RootAccessible.h"
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsMai.h"
#include "nsMaiHyperlink.h"
#include "nsString.h"
@@ -1524,3 +1526,118 @@ AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
return NS_OK;
}
// static
void
AccessibleWrap::GetKeyBinding(Accessible* aAccessible, nsAString& aResult)
{
// Return all key bindings including access key and keyboard shortcut.
// Get access key.
nsAutoString keyBindingsStr;
KeyBinding keyBinding = aAccessible->AccessKey();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
Accessible* parent = aAccessible->Parent();
roles::Role role = parent ? parent->Role() : roles::NOTHING;
if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM ||
role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) {
// It is submenu, expose keyboard shortcuts from menu hierarchy like
// "s;<Alt>f:s"
nsAutoString keysInHierarchyStr = keyBindingsStr;
do {
KeyBinding parentKeyBinding = parent->AccessKey();
if (!parentKeyBinding.IsEmpty()) {
nsAutoString str;
parentKeyBinding.ToString(str, KeyBinding::eAtkFormat);
str.Append(':');
keysInHierarchyStr.Insert(str, 0);
}
} while ((parent = parent->Parent()) && parent->Role() != roles::MENUBAR);
keyBindingsStr.Append(';');
keyBindingsStr.Append(keysInHierarchyStr);
}
} else {
// No access key, add ';' to point this.
keyBindingsStr.Append(';');
}
// Get keyboard shortcut.
keyBindingsStr.Append(';');
keyBinding = aAccessible->KeyboardShortcut();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
}
aResult = keyBindingsStr;
}
// static
Accessible*
AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
{
if (!aAccessible) {
return nullptr;
}
Accessible* cell = aAccessible->CellAt(0, aColIdx);
if (!cell) {
return nullptr;
}
// If the cell at the first row is column header then assume it is column
// header for all rows,
if (cell->Role() == roles::COLUMNHEADER) {
return cell;
}
// otherwise get column header for the data cell at the first row.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell) {
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
}
return headerCells[0];
}
// static
Accessible*
AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
{
if (!aAccessible) {
return nullptr;
}
Accessible* cell = aAccessible->CellAt(aRowIdx, 0);
if (!cell) {
return nullptr;
}
// If the cell at the first column is row header then assume it is row
// header for all columns,
if (cell->Role() == roles::ROWHEADER) {
return cell;
}
// otherwise get row header for the data cell at the first column.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell) {
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
}
return headerCells[0];
}
+6
View File
@@ -69,6 +69,12 @@ public:
return returnedString.get();
}
static void GetKeyBinding(Accessible* aAccessible, nsAString& aResult);
static Accessible* GetColumnHeader(TableAccessible* aAccessible,
int32_t aColIdx);
static Accessible* GetRowHeader(TableAccessible* aAccessible,
int32_t aRowIdx);
protected:
nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject);
+37 -54
View File
@@ -10,7 +10,7 @@
#include "nsMai.h"
#include "Role.h"
#include "mozilla/Likely.h"
#include "ProxyAccessible.h"
#include "nsString.h"
using namespace mozilla::a11y;
@@ -21,86 +21,69 @@ static gboolean
doActionCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
return accWrap && accWrap->DoAction(aActionIndex);
if (accWrap) {
return accWrap->DoAction(aActionIndex);
}
ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction));
return proxy && proxy->DoAction(aActionIndex);
}
static gint
getActionCountCB(AtkAction *aAction)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
return accWrap ? accWrap->ActionCount() : 0;
if (accWrap) {
return accWrap->ActionCount();
}
ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction));
return proxy ? proxy->ActionCount() : 0;
}
static const gchar*
getActionDescriptionCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return nullptr;
nsAutoString description;
accWrap->ActionDescriptionAt(aActionIndex, description);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (accWrap) {
accWrap->ActionDescriptionAt(aActionIndex, description);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
proxy->ActionDescriptionAt(aActionIndex, description);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(description);
}
static const gchar*
getActionNameCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return nullptr;
nsAutoString autoStr;
accWrap->ActionNameAt(aActionIndex, autoStr);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (accWrap) {
accWrap->ActionNameAt(aActionIndex, autoStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
proxy->ActionNameAt(aActionIndex, autoStr);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(autoStr);
}
static const gchar*
getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!acc)
return nullptr;
// Return all key bindings including access key and keyboard shortcut.
nsAutoString keyBindingsStr;
// Get access key.
KeyBinding keyBinding = acc->AccessKey();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
Accessible* parent = acc->Parent();
roles::Role role = parent ? parent->Role() : roles::NOTHING;
if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM ||
role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) {
// It is submenu, expose keyboard shortcuts from menu hierarchy like
// "s;<Alt>f:s"
nsAutoString keysInHierarchyStr = keyBindingsStr;
do {
KeyBinding parentKeyBinding = parent->AccessKey();
if (!parentKeyBinding.IsEmpty()) {
nsAutoString str;
parentKeyBinding.ToString(str, KeyBinding::eAtkFormat);
str.Append(':');
keysInHierarchyStr.Insert(str, 0);
}
} while ((parent = parent->Parent()) && parent->Role() != roles::MENUBAR);
keyBindingsStr.Append(';');
keyBindingsStr.Append(keysInHierarchyStr);
}
AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
if (acc) {
AccessibleWrap::GetKeyBinding(acc, keyBindingsStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
proxy->AtkKeyBinding(keyBindingsStr);
} else {
// No access key, add ';' to point this.
keyBindingsStr.Append(';');
}
// Get keyboard shortcut.
keyBindingsStr.Append(';');
keyBinding = acc->KeyboardShortcut();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
return nullptr;
}
return AccessibleWrap::ReturnString(keyBindingsStr);
+172 -101
View File
@@ -12,7 +12,7 @@
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsMai.h"
#include "ProxyAccessible.h"
#include "nsArrayUtils.h"
#include "mozilla/Likely.h"
@@ -23,17 +23,31 @@ extern "C" {
static AtkObject*
refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
{
if (aRowIdx < 0 || aColIdx < 0) {
return nullptr;
}
AtkObject* cellAtkObj = nullptr;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aRowIdx < 0 || aColIdx < 0)
return nullptr;
if (accWrap) {
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, aColIdx);
if (!cell) {
return nullptr;
}
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, aColIdx);
if (!cell)
return nullptr;
cellAtkObj = AccessibleWrap::GetAtkObject(cell);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* cell = proxy->TableCellAt(aRowIdx, aColIdx);
if (!cell) {
return nullptr;
}
AtkObject* cellAtkObj = AccessibleWrap::GetAtkObject(cell);
if (cellAtkObj)
cellAtkObj = GetWrapperFor(cell);
}
if (cellAtkObj) {
g_object_ref(cellAtkObj);
}
return cellAtkObj;
}
@@ -41,93 +55,153 @@ refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
static gint
getIndexAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aRowIdx < 0 || aColIdx < 0)
if (aRowIdx < 0 || aColIdx < 0) {
return -1;
}
return static_cast<gint>(accWrap->AsTable()->CellIndexAt(aRowIdx, aColIdx));
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->CellIndexAt(aRowIdx, aColIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableCellIndexAt(aRowIdx, aColIdx));
}
return -1;
}
static gint
getColumnAtIndexCB(AtkTable *aTable, gint aIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aIdx < 0)
if (aIdx < 0) {
return -1;
}
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->ColIndexAt(aIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableColumnIndexAt(aIdx));
}
return -1;
}
static gint
getRowAtIndexCB(AtkTable *aTable, gint aIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aIdx < 0)
if (aIdx < 0) {
return -1;
}
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->RowIndexAt(aIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableRowIndexAt(aIdx));
}
return -1;
}
static gint
getColumnCountCB(AtkTable *aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->ColCount());
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableColumnCount());
}
return -1;
}
static gint
getRowCountCB(AtkTable *aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->RowCount());
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableRowCount());
}
return -1;
}
static gint
getColumnExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aRowIdx < 0 || aColIdx < 0)
if (aRowIdx < 0 || aColIdx < 0) {
return -1;
}
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->ColExtentAt(aRowIdx, aColIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableColumnExtentAt(aRowIdx, aColIdx));
}
return -1;
}
static gint
getRowExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->RowExtentAt(aRowIdx, aColIdx));
}
return static_cast<gint>(accWrap->AsTable()->RowExtentAt(aRowIdx, aColIdx));
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableRowExtentAt(aRowIdx, aColIdx));
}
return -1;
}
static AtkObject*
getCaptionCB(AtkTable* aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
if (accWrap) {
Accessible* caption = accWrap->AsTable()->Caption();
return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
}
Accessible* caption = accWrap->AsTable()->Caption();
return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* caption = proxy->TableCaption();
return caption ? GetWrapperFor(caption) : nullptr;
}
return nullptr;
}
static const gchar*
getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
nsAutoString autoStr;
accWrap->AsTable()->ColDescription(aColumn, autoStr);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->ColDescription(aColumn, autoStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableColumnDescription(aColumn, autoStr);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(autoStr);
}
@@ -136,40 +210,32 @@ static AtkObject*
getColumnHeaderCB(AtkTable *aTable, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
if (accWrap) {
Accessible* header =
AccessibleWrap::GetColumnHeader(accWrap->AsTable(), aColIdx);
return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
}
Accessible* cell = accWrap->AsTable()->CellAt(0, aColIdx);
if (!cell)
return nullptr;
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* header = proxy->AtkTableColumnHeader(aColIdx);
return header ? GetWrapperFor(header) : nullptr;
}
// If the cell at the first row is column header then assume it is column
// header for all rows,
if (cell->Role() == roles::COLUMNHEADER)
return AccessibleWrap::GetAtkObject(cell);
// otherwise get column header for the data cell at the first row.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell)
return nullptr;
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty())
return nullptr;
return AccessibleWrap::GetAtkObject(headerCells[0]);
return nullptr;
}
static const gchar*
getRowDescriptionCB(AtkTable *aTable, gint aRow)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
nsAutoString autoStr;
accWrap->AsTable()->RowDescription(aRow, autoStr);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->RowDescription(aRow, autoStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableRowDescription(aRow, autoStr);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(autoStr);
}
@@ -178,29 +244,18 @@ static AtkObject*
getRowHeaderCB(AtkTable *aTable, gint aRowIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
if (accWrap) {
Accessible* header =
AccessibleWrap::GetRowHeader(accWrap->AsTable(), aRowIdx);
return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
}
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, 0);
if (!cell)
return nullptr;
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* header = proxy->AtkTableRowHeader(aRowIdx);
return header ? GetWrapperFor(header) : nullptr;
}
// If the cell at the first column is row header then assume it is row
// header for all columns,
if (cell->Role() == roles::ROWHEADER)
return AccessibleWrap::GetAtkObject(cell);
// otherwise get row header for the data cell at the first column.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell)
return nullptr;
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty())
return nullptr;
return AccessibleWrap::GetAtkObject(headerCells[0]);
return nullptr;
}
static AtkObject*
@@ -218,12 +273,16 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
{
*aSelected = nullptr;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return 0;
nsAutoTArray<uint32_t, 10> cols;
accWrap->AsTable()->SelectedColIndices(&cols);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedColIndices(&cols);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableSelectedColumnIndices(&cols);
} else {
return 0;
}
if (cols.IsEmpty())
return 0;
@@ -241,12 +300,15 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
static gint
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return 0;
nsAutoTArray<uint32_t, 10> rows;
accWrap->AsTable()->SelectedRowIndices(&rows);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedRowIndices(&rows);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableSelectedRowIndices(&rows);
} else {
return 0;
}
gint* atkRows = g_new(gint, rows.Length());
if (!atkRows) {
@@ -263,31 +325,40 @@ static gboolean
isColumnSelectedCB(AtkTable *aTable, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return FALSE;
if (accWrap) {
return static_cast<gboolean>(accWrap->AsTable()->IsColSelected(aColIdx));
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gboolean>(proxy->TableColumnSelected(aColIdx));
}
return static_cast<gboolean>(accWrap->AsTable()->IsColSelected(aColIdx));
return FALSE;
}
static gboolean
isRowSelectedCB(AtkTable *aTable, gint aRowIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return FALSE;
if (accWrap) {
return static_cast<gboolean>(accWrap->AsTable()->IsRowSelected(aRowIdx));
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gboolean>(proxy->TableRowSelected(aRowIdx));
}
return static_cast<gboolean>(accWrap->AsTable()->IsRowSelected(aRowIdx));
return FALSE;
}
static gboolean
isCellSelectedCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return FALSE;
if (accWrap) {
return static_cast<gboolean>(accWrap->AsTable()->
IsCellSelected(aRowIdx, aColIdx));
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gboolean>(proxy->TableCellSelected(aRowIdx, aColIdx));
}
return FALSE;
}
}
+2 -3
View File
@@ -576,9 +576,8 @@ setCaretOffsetCB(AtkText *aText, gint aOffset)
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
if (proxy->SetCaretOffset(aOffset)) {
return TRUE;
}
proxy->SetCaretOffset(aOffset);
return TRUE;
}
return FALSE;
+9 -9
View File
@@ -127,7 +127,7 @@ protected:
bool mIsFromUserInput;
uint32_t mEventType;
EEventRule mEventRule;
nsRefPtr<Accessible> mAccessible;
RefPtr<Accessible> mAccessible;
friend class EventQueue;
friend class AccReorderEvent;
@@ -237,8 +237,8 @@ public:
protected:
nsCOMPtr<nsINode> mNode;
nsRefPtr<Accessible> mParent;
nsRefPtr<AccTextChangeEvent> mTextChangeEvent;
RefPtr<Accessible> mParent;
RefPtr<AccTextChangeEvent> mTextChangeEvent;
friend class EventQueue;
};
@@ -268,8 +268,8 @@ public:
protected:
bool mNeedsShutdown;
nsRefPtr<Accessible> mNextSibling;
nsRefPtr<Accessible> mPrevSibling;
RefPtr<Accessible> mNextSibling;
RefPtr<Accessible> mPrevSibling;
friend class EventQueue;
};
@@ -397,7 +397,7 @@ public:
bool IsCaretMoveOnly() const;
private:
nsRefPtr<dom::Selection> mSel;
RefPtr<dom::Selection> mSel;
int32_t mReason;
friend class EventQueue;
@@ -432,8 +432,8 @@ public:
Accessible* Widget() const { return mWidget; }
private:
nsRefPtr<Accessible> mWidget;
nsRefPtr<Accessible> mItem;
RefPtr<Accessible> mWidget;
RefPtr<Accessible> mItem;
SelChangeType mSelChangeType;
uint32_t mPreceedingCount;
AccSelChangeEvent* mPackedEvent;
@@ -495,7 +495,7 @@ public:
int32_t Reason() const { return mReason; }
private:
nsRefPtr<Accessible> mOldAccessible;
RefPtr<Accessible> mOldAccessible;
int32_t mOldStart;
int32_t mOldEnd;
int16_t mReason;
+1 -1
View File
@@ -394,7 +394,7 @@ ARIAOwnsIterator::Next()
Accessible*
SingleAccIterator::Next()
{
nsRefPtr<Accessible> nextAcc;
RefPtr<Accessible> nextAcc;
mAcc.swap(nextAcc);
if (!nextAcc || nextAcc->IsDefunct()) {
return nullptr;
+1 -1
View File
@@ -306,7 +306,7 @@ private:
SingleAccIterator(const SingleAccIterator&);
SingleAccIterator& operator = (const SingleAccIterator&);
nsRefPtr<Accessible> mAcc;
RefPtr<Accessible> mAcc;
};
+1 -1
View File
@@ -427,7 +427,7 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
// We only create root accessibles for the true root, otherwise create a
// doc accessible.
nsIContent *rootElm = nsCoreUtils::GetRoleContent(aDocument);
nsRefPtr<DocAccessible> docAcc = isRootDoc ?
RefPtr<DocAccessible> docAcc = isRootDoc ?
new RootAccessibleWrap(aDocument, rootElm, presShell) :
new DocAccessibleWrap(aDocument, rootElm, presShell);
+2 -2
View File
@@ -61,7 +61,7 @@ EventQueue::PushEvent(AccEvent* aEvent)
ENameValueFlag nameFlag = parent->Name(name);
// If name is obtained from subtree, fire name change event.
if (nameFlag == eNameFromSubtree) {
nsRefPtr<AccEvent> nameChangeEvent =
RefPtr<AccEvent> nameChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, parent);
PushEvent(nameChangeEvent);
}
@@ -482,7 +482,7 @@ void
EventQueue::ProcessEventQueue()
{
// Process only currently queued events.
nsTArray<nsRefPtr<AccEvent> > events;
nsTArray<RefPtr<AccEvent> > events;
events.SwapElements(mEvents);
uint32_t eventCount = events.Length();
+1 -1
View File
@@ -79,7 +79,7 @@ protected:
* Pending events array. Don't make this an nsAutoTArray; we use
* SwapElements() on it.
*/
nsTArray<nsRefPtr<AccEvent> > mEvents;
nsTArray<RefPtr<AccEvent> > mEvents;
};
} // namespace a11y
+5 -5
View File
@@ -218,7 +218,7 @@ FocusManager::DispatchFocusEvent(DocAccessible* aDocument,
{
NS_PRECONDITION(aDocument, "No document for focused accessible!");
if (aDocument) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, aTarget,
eAutoDetect, AccEvent::eCoalesceOfSameType);
aDocument->FireDelayedEvent(event);
@@ -331,7 +331,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
if (ARIAMenubar != mActiveARIAMenubar) {
// Leaving ARIA menu. Fire menu_end event on current menubar.
if (mActiveARIAMenubar) {
nsRefPtr<AccEvent> menuEndEvent =
RefPtr<AccEvent> menuEndEvent =
new AccEvent(nsIAccessibleEvent::EVENT_MENU_END, mActiveARIAMenubar,
aEvent->FromUserInput());
nsEventShell::FireEvent(menuEndEvent);
@@ -341,7 +341,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
// Entering ARIA menu. Fire menu_start event.
if (mActiveARIAMenubar) {
nsRefPtr<AccEvent> menuStartEvent =
RefPtr<AccEvent> menuStartEvent =
new AccEvent(nsIAccessibleEvent::EVENT_MENU_START,
mActiveARIAMenubar, aEvent->FromUserInput());
nsEventShell::FireEvent(menuStartEvent);
@@ -349,7 +349,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
}
} else if (mActiveARIAMenubar) {
// Focus left a menu. Fire menu_end event.
nsRefPtr<AccEvent> menuEndEvent =
RefPtr<AccEvent> menuEndEvent =
new AccEvent(nsIAccessibleEvent::EVENT_MENU_END, mActiveARIAMenubar,
aEvent->FromUserInput());
nsEventShell::FireEvent(menuEndEvent);
@@ -367,7 +367,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
// offset before the caret move event is handled.
SelectionMgr()->ResetCaretOffset();
nsRefPtr<AccEvent> focusEvent =
RefPtr<AccEvent> focusEvent =
new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, target, aEvent->FromUserInput());
nsEventShell::FireEvent(focusEvent);
+2 -2
View File
@@ -124,8 +124,8 @@ private:
nsIDocument* FocusedDOMDocument() const;
private:
nsRefPtr<Accessible> mActiveItem;
nsRefPtr<Accessible> mActiveARIAMenubar;
RefPtr<Accessible> mActiveItem;
RefPtr<Accessible> mActiveARIAMenubar;
};
} // namespace a11y
+4 -4
View File
@@ -101,7 +101,7 @@ NotificationController::ScheduleContentInsertion(Accessible* aContainer,
nsIContent* aStartChildNode,
nsIContent* aEndChildNode)
{
nsRefPtr<ContentInsertion> insertion = new ContentInsertion(mDocument,
RefPtr<ContentInsertion> insertion = new ContentInsertion(mDocument,
aContainer);
if (insertion && insertion->InitChildList(aStartChildNode, aEndChildNode) &&
mContentInsertions.AppendElement(insertion)) {
@@ -193,7 +193,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
// document accessible.
// Process only currently queued content inserted notifications.
nsTArray<nsRefPtr<ContentInsertion> > contentInsertions;
nsTArray<RefPtr<ContentInsertion> > contentInsertions;
contentInsertions.SwapElements(mContentInsertions);
uint32_t insertionCount = contentInsertions.Length();
@@ -290,7 +290,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
// Bind hanging child documents.
uint32_t hangingDocCnt = mHangingChildDocuments.Length();
nsTArray<nsRefPtr<DocAccessible>> newChildDocs;
nsTArray<RefPtr<DocAccessible>> newChildDocs;
for (uint32_t idx = 0; idx < hangingDocCnt; idx++) {
DocAccessible* childDoc = mHangingChildDocuments[idx];
if (childDoc->IsDefunct())
@@ -336,7 +336,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
}
// Process only currently queued generic notifications.
nsTArray < nsRefPtr<Notification> > notifications;
nsTArray < RefPtr<Notification> > notifications;
notifications.SwapElements(mNotifications);
uint32_t notificationCount = notifications.Length();
+7 -7
View File
@@ -81,7 +81,7 @@ private:
Class* mInstance;
Callback mCallback;
Tuple<nsRefPtr<Args> ...> mArgs;
Tuple<RefPtr<Args> ...> mArgs;
};
/**
@@ -161,7 +161,7 @@ public:
return;
}
nsRefPtr<Notification> notification =
RefPtr<Notification> notification =
new TNotification<Class, Arg>(aInstance, aMethod, aArg);
if (notification && mNotifications.AppendElement(notification))
ScheduleProcessing();
@@ -177,7 +177,7 @@ public:
inline void ScheduleNotification(Class* aInstance,
typename TNotification<Class>::Callback aMethod)
{
nsRefPtr<Notification> notification =
RefPtr<Notification> notification =
new TNotification<Class>(aInstance, aMethod);
if (notification && mNotifications.AppendElement(notification))
ScheduleProcessing();
@@ -227,7 +227,7 @@ private:
/**
* Child documents that needs to be bound to the tree.
*/
nsTArray<nsRefPtr<DocAccessible> > mHangingChildDocuments;
nsTArray<RefPtr<DocAccessible> > mHangingChildDocuments;
/**
* Storage for content inserted notification information.
@@ -257,7 +257,7 @@ private:
DocAccessible* mDocument;
// The container accessible that content insertion occurs within.
nsRefPtr<Accessible> mContainer;
RefPtr<Accessible> mContainer;
// Array of inserted contents.
nsTArray<nsCOMPtr<nsIContent> > mInsertedContent;
@@ -267,7 +267,7 @@ private:
* A pending accessible tree update notifications for content insertions.
* Don't make this an nsAutoTArray; we use SwapElements() on it.
*/
nsTArray<nsRefPtr<ContentInsertion> > mContentInsertions;
nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
template<class T>
class nsCOMPtrHashKey : public PLDHashEntryHdr
@@ -302,7 +302,7 @@ private:
* Other notifications like DOM events. Don't make this an nsAutoTArray; we
* use SwapElements() on it.
*/
nsTArray<nsRefPtr<Notification> > mNotifications;
nsTArray<RefPtr<Notification> > mNotifications;
};
} // namespace a11y
+4 -4
View File
@@ -29,7 +29,7 @@ struct mozilla::a11y::SelData final
SelData(Selection* aSel, int32_t aReason) :
mSel(aSel), mReason(aReason) {}
nsRefPtr<Selection> mSel;
RefPtr<Selection> mSel;
int16_t mReason;
NS_INLINE_DECL_REFCOUNTING(SelData)
@@ -159,7 +159,7 @@ SelectionManager::ProcessTextSelChangeEvent(AccEvent* aEvent)
selection->FocusOffset());
mAccWithCaret = caretCntr;
if (mCaretOffset != -1) {
nsRefPtr<AccCaretMoveEvent> caretMoveEvent =
RefPtr<AccCaretMoveEvent> caretMoveEvent =
new AccCaretMoveEvent(caretCntr, mCaretOffset, aEvent->FromUserInput());
nsEventShell::FireEvent(caretMoveEvent);
}
@@ -184,7 +184,7 @@ SelectionManager::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
// Selection manager has longer lifetime than any document accessible,
// so that we are guaranteed that the notification is processed before
// the selection manager is destroyed.
nsRefPtr<SelData> selData =
RefPtr<SelData> selData =
new SelData(static_cast<Selection*>(aSelection), aReason);
document->HandleNotification<SelectionManager, SelData>
(this, &SelectionManager::ProcessSelectionChanged, selData);
@@ -221,7 +221,7 @@ SelectionManager::ProcessSelectionChanged(SelData* aSelData)
}
if (selection->GetType() == nsISelectionController::SELECTION_NORMAL) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccTextSelChangeEvent(text, selection, aSelData->mReason);
text->Document()->FireDelayedEvent(event);
+1 -1
View File
@@ -39,7 +39,7 @@ private:
void Margin(Side aSide, nsAString& aValue);
dom::Element* mElement;
nsRefPtr<nsStyleContext> mStyleContext;
RefPtr<nsStyleContext> mStyleContext;
};
} // namespace a11y
+2 -2
View File
@@ -460,7 +460,7 @@ bool
TextAttrsMgr::FontFamilyTextAttr::
GetFontFamily(nsIFrame* aFrame, nsString& aFamily)
{
nsRefPtr<nsFontMetrics> fm;
RefPtr<nsFontMetrics> fm;
nsLayoutUtils::GetFontMetricsForFrame(aFrame, getter_AddRefs(fm));
gfxFontGroup* fontGroup = fm->GetThebesFontGroup();
@@ -618,7 +618,7 @@ TextAttrsMgr::FontWeightTextAttr::
{
// nsFont::width isn't suitable here because it's necessary to expose real
// value of font weight (used font might not have some font weight values).
nsRefPtr<nsFontMetrics> fm;
RefPtr<nsFontMetrics> fm;
nsLayoutUtils::GetFontMetricsForFrame(aFrame, getter_AddRefs(fm));
gfxFontGroup *fontGroup = fm->GetThebesFontGroup();
+3 -3
View File
@@ -243,9 +243,9 @@ private:
HyperTextAccessible* aStopContainer = nullptr,
int32_t aStopOffset = 0);
nsRefPtr<HyperTextAccessible> mRoot;
nsRefPtr<HyperTextAccessible> mStartContainer;
nsRefPtr<HyperTextAccessible> mEndContainer;
RefPtr<HyperTextAccessible> mRoot;
RefPtr<HyperTextAccessible> mStartContainer;
RefPtr<HyperTextAccessible> mEndContainer;
int32_t mStartOffset;
int32_t mEndOffset;
};
+4 -4
View File
@@ -81,14 +81,14 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
strLen1 > kMaxStrLen || strLen2 > kMaxStrLen) {
if (strLen1 > 0) {
// Fire text change event for removal.
nsRefPtr<AccEvent> textRemoveEvent =
RefPtr<AccEvent> textRemoveEvent =
new AccTextChangeEvent(mHyperText, mTextOffset, str1, false);
mDocument->FireDelayedEvent(textRemoveEvent);
}
if (strLen2 > 0) {
// Fire text change event for insertion.
nsRefPtr<AccEvent> textInsertEvent =
RefPtr<AccEvent> textInsertEvent =
new AccTextChangeEvent(mHyperText, mTextOffset, str2, true);
mDocument->FireDelayedEvent(textInsertEvent);
}
@@ -129,7 +129,7 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
}
// Compute events based on the difference.
nsTArray<nsRefPtr<AccEvent> > events;
nsTArray<RefPtr<AccEvent> > events;
ComputeTextChangeEvents(str1, str2, entries, events);
delete [] entries;
@@ -148,7 +148,7 @@ void
TextUpdater::ComputeTextChangeEvents(const nsAString& aStr1,
const nsAString& aStr2,
uint32_t* aEntries,
nsTArray<nsRefPtr<AccEvent> >& aEvents)
nsTArray<RefPtr<AccEvent> >& aEvents)
{
int32_t colIdx = aStr1.Length(), rowIdx = aStr2.Length();
+5 -5
View File
@@ -51,15 +51,15 @@ private:
void ComputeTextChangeEvents(const nsAString& aStr1,
const nsAString& aStr2,
uint32_t* aEntries,
nsTArray<nsRefPtr<AccEvent> >& aEvents);
nsTArray<RefPtr<AccEvent> >& aEvents);
/**
* Helper to create text change events for inserted text.
*/
inline void FireInsertEvent(const nsAString& aText, uint32_t aAddlOffset,
nsTArray<nsRefPtr<AccEvent> >& aEvents)
nsTArray<RefPtr<AccEvent> >& aEvents)
{
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
aText, true);
aEvents.AppendElement(event);
@@ -69,9 +69,9 @@ private:
* Helper to create text change events for removed text.
*/
inline void FireDeleteEvent(const nsAString& aText, uint32_t aAddlOffset,
nsTArray<nsRefPtr<AccEvent> >& aEvents)
nsTArray<RefPtr<AccEvent> >& aEvents)
{
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
aText, false);
aEvents.AppendElement(event);
+2 -2
View File
@@ -17,7 +17,7 @@
*/
template <class T>
static PLDHashOperator
ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessible, void* aUserArg)
ClearCacheEntry(const void* aKey, RefPtr<T>& aAccessible, void* aUserArg)
{
NS_ASSERTION(aAccessible, "Calling ClearCacheEntry with a nullptr pointer!");
if (aAccessible && !aAccessible->IsDefunct())
@@ -28,7 +28,7 @@ ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessible, void* aUserArg)
template <class T>
static PLDHashOperator
UnbindCacheEntryFromDocument(const void* aKey, nsRefPtr<T>& aAccessible,
UnbindCacheEntryFromDocument(const void* aKey, RefPtr<T>& aAccessible,
void* aUserArg)
{
MOZ_ASSERT(aAccessible && !aAccessible->IsDefunct());
+13 -13
View File
@@ -456,7 +456,7 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
return nullptr;
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
nsRefPtr<nsNPAPIPluginInstance> pluginInstance;
RefPtr<nsNPAPIPluginInstance> pluginInstance;
if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) &&
pluginInstance) {
#ifdef XP_WIN
@@ -464,7 +464,7 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
(Preferences::GetBool("accessibility.delay_plugins") ||
Compatibility::IsJAWS() || Compatibility::IsWE())) {
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
nsRefPtr<PluginTimerCallBack> cb = new PluginTimerCallBack(aContent);
RefPtr<PluginTimerCallBack> cb = new PluginTimerCallBack(aContent);
timer->InitWithCallback(cb, Preferences::GetUint("accessibility.delay_plugin_time"),
nsITimer::TYPE_ONE_SHOT);
sPluginTimers->AppendElement(timer);
@@ -481,7 +481,7 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
HWND pluginPort = nullptr;
aFrame->GetPluginPort(&pluginPort);
nsRefPtr<Accessible> accessible =
RefPtr<Accessible> accessible =
new HTMLWin32ObjectOwnerAccessible(aContent, aContext->Document(),
pluginPort);
return accessible.forget();
@@ -496,7 +496,7 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
nsresult rv = pluginInstance->GetValueFromPlugin(
NPPVpluginNativeAccessibleAtkPlugId, &plugId);
if (NS_SUCCEEDED(rv) && !plugId.IsEmpty()) {
nsRefPtr<AtkSocketAccessible> socketAccessible =
RefPtr<AtkSocketAccessible> socketAccessible =
new AtkSocketAccessible(aContent, aContext->Document(), plugId);
return socketAccessible.forget();
@@ -787,7 +787,7 @@ NS_IMETHODIMP
nsAccessibilityService::GetStringStates(uint32_t aState, uint32_t aExtraState,
nsISupports **aStringStates)
{
nsRefPtr<DOMStringList> stringStates = new DOMStringList();
RefPtr<DOMStringList> stringStates = new DOMStringList();
uint64_t state = nsAccUtils::To64State(aState, aExtraState);
@@ -1087,7 +1087,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
#endif
// Attempt to create an accessible based on what we know.
nsRefPtr<Accessible> newAcc;
RefPtr<Accessible> newAcc;
// Create accessible for visible text frames.
if (content->IsNodeOfType(nsINode::eTEXT)) {
@@ -1423,11 +1423,11 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
return nullptr;
if (role.EqualsLiteral("outerdoc")) {
nsRefPtr<Accessible> accessible = new OuterDocAccessible(aContent, aDoc);
RefPtr<Accessible> accessible = new OuterDocAccessible(aContent, aDoc);
return accessible.forget();
}
nsRefPtr<Accessible> accessible;
RefPtr<Accessible> accessible;
#ifdef MOZ_XUL
// XUL controls
if (role.EqualsLiteral("xul:alert")) {
@@ -1599,7 +1599,7 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
{
DocAccessible* document = aContext->Document();
nsRefPtr<Accessible> newAcc;
RefPtr<Accessible> newAcc;
switch (aFrame->AccessibleType()) {
case eNoType:
return nullptr;
@@ -1826,7 +1826,7 @@ NS_GetAccessibilityService(nsIAccessibilityService** aResult)
return NS_OK;
}
nsRefPtr<nsAccessibilityService> service = new nsAccessibilityService();
RefPtr<nsAccessibilityService> service = new nsAccessibilityService();
NS_ENSURE_TRUE(service, NS_ERROR_OUT_OF_MEMORY);
if (!service->Init()) {
@@ -1859,19 +1859,19 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
if (!treeFrame)
return nullptr;
nsRefPtr<nsTreeColumns> treeCols = treeFrame->Columns();
RefPtr<nsTreeColumns> treeCols = treeFrame->Columns();
int32_t count = 0;
treeCols->GetCount(&count);
// Outline of list accessible.
if (count == 1) {
nsRefPtr<Accessible> accessible =
RefPtr<Accessible> accessible =
new XULTreeAccessible(aContent, aDoc, treeFrame);
return accessible.forget();
}
// Table or tree table accessible.
nsRefPtr<Accessible> accessible =
RefPtr<Accessible> accessible =
new XULTreeGridAccessibleWrap(aContent, aDoc, treeFrame);
return accessible.forget();
}
+3 -3
View File
@@ -89,7 +89,7 @@ nsAccessiblePivot::GetPosition(nsIAccessible** aPosition)
NS_IMETHODIMP
nsAccessiblePivot::SetPosition(nsIAccessible* aPosition)
{
nsRefPtr<Accessible> position = nullptr;
RefPtr<Accessible> position = nullptr;
if (aPosition) {
position = aPosition->ToInternalAccessible();
@@ -168,7 +168,7 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
nsCOMPtr<nsIAccessible> xpcAcc = do_QueryInterface(aTextAccessible);
NS_ENSURE_ARG(xpcAcc);
nsRefPtr<Accessible> acc = xpcAcc->ToInternalAccessible();
RefPtr<Accessible> acc = xpcAcc->ToInternalAccessible();
NS_ENSURE_ARG(acc);
HyperTextAccessible* position = acc->AsHyperText();
@@ -643,7 +643,7 @@ nsAccessiblePivot::MovePivotInternal(Accessible* aPosition,
PivotMoveReason aReason,
bool aIsFromUserInput)
{
nsRefPtr<Accessible> oldPosition = mPosition.forget();
RefPtr<Accessible> oldPosition = mPosition.forget();
mPosition = aPosition;
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
mStartOffset = mEndOffset = -1;
+3 -3
View File
@@ -114,17 +114,17 @@ private:
/*
* The root accessible.
*/
nsRefPtr<Accessible> mRoot;
RefPtr<Accessible> mRoot;
/*
* The temporary modal root accessible.
*/
nsRefPtr<Accessible> mModalRoot;
RefPtr<Accessible> mModalRoot;
/*
* The current pivot position.
*/
nsRefPtr<Accessible> mPosition;
RefPtr<Accessible> mPosition;
/*
* The text start offset ofthe pivot.
+2 -2
View File
@@ -102,7 +102,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
nsIWidget *rootWidget =
rootFrame->GetViewExternal()->GetNearestWidget(&offset);
nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
RefPtr<nsPresContext> presContext = presShell->GetPresContext();
int32_t cnvdX = presContext->CSSPixelsToDevPixels(tcX + x + 1) +
presContext->AppUnitsToDevPixels(offset.x);
@@ -149,7 +149,7 @@ nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX, int32_t aY,
event.time = PR_IntervalNow();
// XXX: Touch has an identifier of -1 to hint that it is synthesized.
nsRefPtr<dom::Touch> t = new dom::Touch(-1, LayoutDeviceIntPoint(aX, aY),
RefPtr<dom::Touch> t = new dom::Touch(-1, LayoutDeviceIntPoint(aX, aY),
nsIntPoint(1, 1), 0.0f, 1.0f);
t->SetTarget(aContent);
event.touches.AppendElement(t);
+1 -1
View File
@@ -42,7 +42,7 @@ nsEventShell::FireEvent(uint32_t aEventType, Accessible* aAccessible,
{
NS_ENSURE_TRUE_VOID(aAccessible);
nsRefPtr<AccEvent> event = new AccEvent(aEventType, aAccessible,
RefPtr<AccEvent> event = new AccEvent(aEventType, aAccessible,
aIsFromUserInput);
FireEvent(event);
+1 -1
View File
@@ -41,7 +41,7 @@ public:
static void FireEvent(mozilla::a11y::Accessible* aTarget, uint64_t aState,
bool aIsEnabled, bool aIsFromUserInput)
{
nsRefPtr<mozilla::a11y::AccStateChangeEvent> stateChangeEvent =
RefPtr<mozilla::a11y::AccStateChangeEvent> stateChangeEvent =
new mozilla::a11y::AccStateChangeEvent(aTarget, aState, aIsEnabled,
(aIsFromUserInput ?
mozilla::a11y::eFromUserInput :
+43 -40
View File
@@ -835,47 +835,50 @@ Accessible::HandleAccEvent(AccEvent* aEvent)
if (IPCAccessibilityActive() && Document()) {
DocAccessibleChild* ipcDoc = mDoc->IPCDoc();
uint64_t id = aEvent->GetAccessible()->IsDoc() ? 0 :
reinterpret_cast<uintptr_t>(aEvent->GetAccessible());
MOZ_ASSERT(ipcDoc);
if (ipcDoc) {
uint64_t id = aEvent->GetAccessible()->IsDoc() ? 0 :
reinterpret_cast<uintptr_t>(aEvent->GetAccessible());
switch(aEvent->GetEventType()) {
case nsIAccessibleEvent::EVENT_SHOW:
ipcDoc->ShowEvent(downcast_accEvent(aEvent));
break;
switch(aEvent->GetEventType()) {
case nsIAccessibleEvent::EVENT_SHOW:
ipcDoc->ShowEvent(downcast_accEvent(aEvent));
break;
case nsIAccessibleEvent::EVENT_HIDE:
ipcDoc->SendHideEvent(id);
break;
case nsIAccessibleEvent::EVENT_HIDE:
ipcDoc->SendHideEvent(id);
break;
case nsIAccessibleEvent::EVENT_REORDER:
// reorder events on the application acc aren't necessary to tell the parent
// about new top level documents.
if (!aEvent->GetAccessible()->IsApplication())
ipcDoc->SendEvent(id, aEvent->GetEventType());
break;
case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
AccStateChangeEvent* event = downcast_accEvent(aEvent);
ipcDoc->SendStateChangeEvent(id, event->GetState(),
event->IsStateEnabled());
break;
}
case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
AccCaretMoveEvent* event = downcast_accEvent(aEvent);
ipcDoc->SendEvent(id, event->GetCaretOffset());
break;
}
case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
AccTextChangeEvent* event = downcast_accEvent(aEvent);
ipcDoc->SendTextChangeEvent(id, event->ModifiedText(),
event->GetStartOffset(),
event->GetLength(),
event->IsTextInserted(),
event->IsFromUserInput());
break;
}
default:
ipcDoc->SendEvent(id, aEvent->GetEventType());
case nsIAccessibleEvent::EVENT_REORDER:
// reorder events on the application acc aren't necessary to tell the parent
// about new top level documents.
if (!aEvent->GetAccessible()->IsApplication())
ipcDoc->SendEvent(id, aEvent->GetEventType());
break;
case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
AccStateChangeEvent* event = downcast_accEvent(aEvent);
ipcDoc->SendStateChangeEvent(id, event->GetState(),
event->IsStateEnabled());
break;
}
case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
AccCaretMoveEvent* event = downcast_accEvent(aEvent);
ipcDoc->SendEvent(id, event->GetCaretOffset());
break;
}
case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
AccTextChangeEvent* event = downcast_accEvent(aEvent);
ipcDoc->SendTextChangeEvent(id, event->ModifiedText(),
event->GetStartOffset(),
event->GetLength(),
event->IsTextInserted(),
event->IsFromUserInput());
break;
}
default:
ipcDoc->SendEvent(id, aEvent->GetEventType());
}
}
}
@@ -1790,7 +1793,7 @@ Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
}
private:
nsRefPtr<Accessible> mAcc;
RefPtr<Accessible> mAcc;
nsCOMPtr<nsIContent> mContent;
uint32_t mIdx;
};
@@ -1826,7 +1829,7 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
nsSize size = frame->GetSize();
nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
RefPtr<nsPresContext> presContext = presShell->GetPresContext();
int32_t x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
int32_t y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);
+2 -2
View File
@@ -1116,8 +1116,8 @@ protected:
nsCOMPtr<nsIContent> mContent;
DocAccessible* mDoc;
nsRefPtr<Accessible> mParent;
nsTArray<nsRefPtr<Accessible> > mChildren;
RefPtr<Accessible> mParent;
nsTArray<RefPtr<Accessible> > mChildren;
int32_t mIndexInParent;
static const uint8_t kChildrenFlagsBits = 2;
+2 -2
View File
@@ -45,7 +45,7 @@ DocAccessible::FireDelayedEvent(AccEvent* aEvent)
inline void
DocAccessible::FireDelayedEvent(uint32_t aEventType, Accessible* aTarget)
{
nsRefPtr<AccEvent> event = new AccEvent(aEventType, aTarget);
RefPtr<AccEvent> event = new AccEvent(aEventType, aTarget);
FireDelayedEvent(event);
}
@@ -113,7 +113,7 @@ DocAccessible::NotifyOfLoad(uint32_t aLoadEventType)
// If the document is loaded completely then network activity was presumingly
// caused by file loading. Fire busy state change event.
if (HasLoadState(eCompletelyLoaded) && IsLoadEventTarget()) {
nsRefPtr<AccEvent> stateEvent =
RefPtr<AccEvent> stateEvent =
new AccStateChangeEvent(this, states::BUSY, false);
FireDelayedEvent(stateEvent);
}
+34 -34
View File
@@ -654,7 +654,7 @@ DocAccessible::Observe(nsISupports* aSubject, const char* aTopic,
// Normally we only fire delayed events created from the node, not an
// accessible object. See the AccStateChangeEvent constructor for details
// about this exceptional case.
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(this, states::EDITABLE, true);
FireDelayedEvent(event);
}
@@ -672,7 +672,7 @@ DocAccessible::OnPivotChanged(nsIAccessiblePivot* aPivot,
PivotMoveReason aReason,
bool aIsFromUserInput)
{
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccVCChangeEvent(
this, (aOldAccessible ? aOldAccessible->ToInternalAccessible() : nullptr),
aOldStart, aOldEnd, aReason,
@@ -809,11 +809,11 @@ DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
if (aAccessible->Unavailable() == mStateBitWasOn)
return;
nsRefPtr<AccEvent> enabledChangeEvent =
RefPtr<AccEvent> enabledChangeEvent =
new AccStateChangeEvent(aAccessible, states::ENABLED, mStateBitWasOn);
FireDelayedEvent(enabledChangeEvent);
nsRefPtr<AccEvent> sensitiveChangeEvent =
RefPtr<AccEvent> sensitiveChangeEvent =
new AccStateChangeEvent(aAccessible, states::SENSITIVE, mStateBitWasOn);
FireDelayedEvent(sensitiveChangeEvent);
return;
@@ -872,7 +872,7 @@ DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
if (aAttribute == nsGkAtoms::aria_busy) {
bool isOn = elm->AttrValueIs(aNameSpaceID, aAttribute, nsGkAtoms::_true,
eCaseMatters);
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::BUSY, isOn);
FireDelayedEvent(event);
return;
@@ -889,7 +889,7 @@ DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
elm->AttrValueIs(aNameSpaceID, aAttribute, nsGkAtoms::_true, eCaseMatters) ?
AccSelChangeEvent::eSelectionAdd : AccSelChangeEvent::eSelectionRemove;
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccSelChangeEvent(widget, aAccessible, selChangeType);
FireDelayedEvent(event);
}
@@ -898,7 +898,7 @@ DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
}
if (aAttribute == nsGkAtoms::contenteditable) {
nsRefPtr<AccEvent> editableChangeEvent =
RefPtr<AccEvent> editableChangeEvent =
new AccStateChangeEvent(aAccessible, states::EDITABLE);
FireDelayedEvent(editableChangeEvent);
return;
@@ -918,14 +918,14 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
// there is an ARIA role present or not.
if (aAttribute == nsGkAtoms::aria_required) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::REQUIRED);
FireDelayedEvent(event);
return;
}
if (aAttribute == nsGkAtoms::aria_invalid) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::INVALID);
FireDelayedEvent(event);
return;
@@ -943,7 +943,7 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
// We treat aria-expanded as a global ARIA state for historical reasons
if (aAttribute == nsGkAtoms::aria_expanded) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::EXPANDED);
FireDelayedEvent(event);
return;
@@ -953,7 +953,7 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
// change event; at least until native API comes up with a more meaningful event.
uint8_t attrFlags = aria::AttrCharacteristicsFor(aAttribute);
if (!(attrFlags & ATTR_BYPASSOBJ)) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccObjectAttrChangedEvent(aAccessible, aAttribute);
FireDelayedEvent(event);
}
@@ -969,7 +969,7 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
!aAccessible->Parent()->IsARIAHidden()) {
aAccessible->SetARIAHidden(isDefined);
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccObjectAttrChangedEvent(aAccessible, aAttribute);
FireDelayedEvent(event);
}
@@ -981,14 +981,14 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
aAttribute == nsGkAtoms::aria_pressed)) {
const uint64_t kState = (aAttribute == nsGkAtoms::aria_checked) ?
states::CHECKED : states::PRESSED;
nsRefPtr<AccEvent> event = new AccStateChangeEvent(aAccessible, kState);
RefPtr<AccEvent> event = new AccStateChangeEvent(aAccessible, kState);
FireDelayedEvent(event);
bool wasMixed = (mARIAAttrOldValue == nsGkAtoms::mixed);
bool isMixed = elm->AttrValueIs(kNameSpaceID_None, aAttribute,
nsGkAtoms::mixed, eCaseMatters);
if (isMixed != wasMixed) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::MIXED, isMixed);
FireDelayedEvent(event);
}
@@ -996,7 +996,7 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
}
if (aAttribute == nsGkAtoms::aria_readonly) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::READONLY);
FireDelayedEvent(event);
return;
@@ -1060,26 +1060,26 @@ DocAccessible::ContentStateChanged(nsIDocument* aDocument,
AccSelChangeEvent::SelChangeType selChangeType =
aContent->AsElement()->State().HasState(NS_EVENT_STATE_CHECKED) ?
AccSelChangeEvent::eSelectionAdd : AccSelChangeEvent::eSelectionRemove;
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccSelChangeEvent(widget, accessible, selChangeType);
FireDelayedEvent(event);
return;
}
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(accessible, states::CHECKED,
aContent->AsElement()->State().HasState(NS_EVENT_STATE_CHECKED));
FireDelayedEvent(event);
}
if (aStateMask.HasState(NS_EVENT_STATE_INVALID)) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(accessible, states::INVALID, true);
FireDelayedEvent(event);
}
if (aStateMask.HasState(NS_EVENT_STATE_VISITED)) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(accessible, states::TRAVERSED, true);
FireDelayedEvent(event);
}
@@ -1349,8 +1349,8 @@ DocAccessible::ProcessInvalidationList()
// XXX: update context flags
{
Accessible* oldParent = child->Parent();
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(oldParent);
nsRefPtr<AccMutationEvent> hideEvent =
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(oldParent);
RefPtr<AccMutationEvent> hideEvent =
new AccHideEvent(child, child->GetContent(), false);
FireDelayedEvent(hideEvent);
reorderEvent->AddSubMutationEvent(hideEvent);
@@ -1363,8 +1363,8 @@ DocAccessible::ProcessInvalidationList()
}
{
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(owner);
nsRefPtr<AccMutationEvent> showEvent =
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(owner);
RefPtr<AccMutationEvent> showEvent =
new AccShowEvent(child, child->GetContent());
FireDelayedEvent(showEvent);
reorderEvent->AddSubMutationEvent(showEvent);
@@ -1453,14 +1453,14 @@ DocAccessible::NotifyOfLoading(bool aIsReloading)
// Fire reload and state busy events on existing document accessible while
// event from user input flag can be calculated properly and accessible
// is alive. When new document gets loaded then this one is destroyed.
nsRefPtr<AccEvent> reloadEvent =
RefPtr<AccEvent> reloadEvent =
new AccEvent(nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD, this);
nsEventShell::FireEvent(reloadEvent);
}
// Fire state busy change event. Use delayed event since we don't care
// actually if event isn't delivered when the document goes away like a shot.
nsRefPtr<AccEvent> stateEvent =
RefPtr<AccEvent> stateEvent =
new AccStateChangeEvent(this, states::BUSY, true);
FireDelayedEvent(stateEvent);
}
@@ -1492,14 +1492,14 @@ DocAccessible::DoInitialUpdate()
// this document may be fired prior to this reorder event. If this is
// a problem then consider to keep event processing per tab document.
if (!IsRoot()) {
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(Parent());
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(Parent());
ParentDocument()->FireDelayedEvent(reorderEvent);
}
uint32_t childCount = ChildCount();
for (uint32_t i = 0; i < childCount; i++) {
Accessible* child = GetChildAt(i);
nsRefPtr<AccShowEvent> event = new AccShowEvent(child, child->GetContent());
RefPtr<AccShowEvent> event = new AccShowEvent(child, child->GetContent());
FireDelayedEvent(event);
}
}
@@ -1525,14 +1525,14 @@ DocAccessible::ProcessLoad()
// Fire complete/load stopped if the load event type is given.
if (mLoadEventType) {
nsRefPtr<AccEvent> loadEvent = new AccEvent(mLoadEventType, this);
RefPtr<AccEvent> loadEvent = new AccEvent(mLoadEventType, this);
FireDelayedEvent(loadEvent);
mLoadEventType = 0;
}
// Fire busy state change event.
nsRefPtr<AccEvent> stateEvent =
RefPtr<AccEvent> stateEvent =
new AccStateChangeEvent(this, states::BUSY, false);
FireDelayedEvent(stateEvent);
}
@@ -1683,7 +1683,7 @@ DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
nsTArray<Accessible*> containers;
// Remove ARIA owned elements from where they belonged.
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aRelProvider);
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aRelProvider);
{
AutoTreeMutation mut(aRelProvider);
for (uint32_t idx = 0; idx < children->Length(); idx++) {
@@ -1691,7 +1691,7 @@ DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
Accessible* child = GetAccessible(childEl);
if (child && child->IsRepositioned()) {
{
nsRefPtr<AccMutationEvent> hideEvent =
RefPtr<AccMutationEvent> hideEvent =
new AccHideEvent(child, childEl, false);
FireDelayedEvent(hideEvent);
reorderEvent->AddSubMutationEvent(hideEvent);
@@ -1842,7 +1842,7 @@ DocAccessible::UpdateTreeOnInsertion(Accessible* aContainer)
aContainer->InvalidateChildren();
aContainer->EnsureChildren();
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aContainer);
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aContainer);
uint32_t updateFlags = eNoAccessible;
for (uint32_t idx = 0; idx < aContainer->ContentChildCount(); idx++) {
@@ -1914,7 +1914,7 @@ DocAccessible::UpdateTreeOnRemoval(Accessible* aContainer, nsIContent* aChildNod
#endif
uint32_t updateFlags = eNoAccessible;
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aContainer);
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aContainer);
AutoTreeMutation mut(aContainer);
if (child) {
@@ -1996,7 +1996,7 @@ DocAccessible::UpdateTreeInternal(Accessible* aChild, bool aIsInsert,
}
// Fire show/hide event.
nsRefPtr<AccMutationEvent> event;
RefPtr<AccMutationEvent> event;
if (aIsInsert)
event = new AccShowEvent(aChild, node);
else
+4 -4
View File
@@ -618,12 +618,12 @@ protected:
bool mStateBitWasOn;
};
nsTArray<nsRefPtr<DocAccessible> > mChildDocuments;
nsTArray<RefPtr<DocAccessible> > mChildDocuments;
/**
* The virtual cursor of the document.
*/
nsRefPtr<nsAccessiblePivot> mVirtualCursor;
RefPtr<nsAccessiblePivot> mVirtualCursor;
/**
* A storage class for pairing content with one of its relation attributes.
@@ -665,7 +665,7 @@ protected:
*
* @see ProcessInvalidationList
*/
nsTArray<nsRefPtr<nsIContent>> mInvalidationList;
nsTArray<RefPtr<nsIContent>> mInvalidationList;
/**
* Holds a list of aria-owns relations.
@@ -689,7 +689,7 @@ protected:
/**
* Used to process notification from core and accessible events.
*/
nsRefPtr<NotificationController> mNotificationController;
RefPtr<NotificationController> mNotificationController;
friend class EventQueue;
friend class NotificationController;
+2 -2
View File
@@ -142,7 +142,7 @@ HyperTextAccessible::AdjustCaretOffset(uint32_t aOffset) const
inline bool
HyperTextAccessible::IsCaretAtEndOfLine() const
{
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
RefPtr<nsFrameSelection> frameSelection = FrameSelection();
return frameSelection &&
frameSelection->GetHint() == CARET_ASSOCIATE_BEFORE;
}
@@ -157,7 +157,7 @@ HyperTextAccessible::FrameSelection() const
inline dom::Selection*
HyperTextAccessible::DOMSelection() const
{
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
RefPtr<nsFrameSelection> frameSelection = FrameSelection();
return frameSelection ?
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL) :
nullptr;
+7 -7
View File
@@ -1221,7 +1221,7 @@ HyperTextAccessible::CaretLineNumber()
{
// Provide the line number for the caret, relative to the
// currently focused node. Use a 1-based index
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
RefPtr<nsFrameSelection> frameSelection = FrameSelection();
if (!frameSelection)
return -1;
@@ -1290,7 +1290,7 @@ HyperTextAccessible::GetCaretRect(nsIWidget** aWidget)
{
*aWidget = nullptr;
nsRefPtr<nsCaret> caret = mDoc->PresShell()->GetCaret();
RefPtr<nsCaret> caret = mDoc->PresShell()->GetCaret();
NS_ENSURE_TRUE(caret, nsIntRect());
bool isVisible = caret->IsVisible();
@@ -1332,7 +1332,7 @@ HyperTextAccessible::GetSelectionDOMRanges(int16_t aType,
nsTArray<nsRange*>* aRanges)
{
// Ignore selection if it is not visible.
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
RefPtr<nsFrameSelection> frameSelection = FrameSelection();
if (!frameSelection ||
frameSelection->GetDisplaySelection() <= nsISelectionController::SELECTION_HIDDEN)
return;
@@ -1440,7 +1440,7 @@ HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
if (!domSel)
return false;
nsRefPtr<nsRange> range;
RefPtr<nsRange> range;
uint32_t rangeCount = domSel->RangeCount();
if (aSelectionNum == static_cast<int32_t>(rangeCount))
range = new nsRange(mContent);
@@ -1480,7 +1480,7 @@ void
HyperTextAccessible::ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
uint32_t aScrollType)
{
nsRefPtr<nsRange> range = new nsRange(mContent);
RefPtr<nsRange> range = new nsRange(mContent);
if (OffsetsToDOMRange(aStartOffset, aEndOffset, range))
nsCoreUtils::ScrollSubstringTo(GetFrame(), range, aScrollType);
}
@@ -1498,7 +1498,7 @@ HyperTextAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
nsIntPoint coords = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType,
this);
nsRefPtr<nsRange> range = new nsRange(mContent);
RefPtr<nsRange> range = new nsRange(mContent);
if (!OffsetsToDOMRange(aStartOffset, aEndOffset, range))
return;
@@ -1892,7 +1892,7 @@ HyperTextAccessible::GetSpellTextAttr(nsINode* aNode,
uint32_t* aEndOffset,
nsIPersistentProperties* aAttributes)
{
nsRefPtr<nsFrameSelection> fs = FrameSelection();
RefPtr<nsFrameSelection> fs = FrameSelection();
if (!fs)
return;
+6 -6
View File
@@ -310,7 +310,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
bool isEnabled = (state & (states::CHECKED | states::SELECTED)) != 0;
if (accessible->NeedsDOMUIEvent()) {
nsRefPtr<AccEvent> accEvent =
RefPtr<AccEvent> accEvent =
new AccStateChangeEvent(accessible, states::CHECKED, isEnabled);
nsEventShell::FireEvent(accEvent);
}
@@ -331,7 +331,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
uint64_t state = accessible->State();
bool isEnabled = !!(state & states::CHECKED);
nsRefPtr<AccEvent> accEvent =
RefPtr<AccEvent> accEvent =
new AccStateChangeEvent(accessible, states::CHECKED, isEnabled);
nsEventShell::FireEvent(accEvent);
}
@@ -351,7 +351,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
uint64_t state = accessible->State();
bool isEnabled = (state & states::EXPANDED) != 0;
nsRefPtr<AccEvent> accEvent =
RefPtr<AccEvent> accEvent =
new AccStateChangeEvent(accessible, states::EXPANDED, isEnabled);
nsEventShell::FireEvent(accEvent);
return;
@@ -377,7 +377,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
return;
}
nsRefPtr<AccSelChangeEvent> selChangeEvent =
RefPtr<AccSelChangeEvent> selChangeEvent =
new AccSelChangeEvent(treeAcc, treeItemAcc,
AccSelChangeEvent::eSelectionAdd);
nsEventShell::FireEvent(selChangeEvent);
@@ -536,7 +536,7 @@ RootAccessible::HandlePopupShownEvent(Accessible* aAccessible)
roles::Role comboboxRole = combobox->Role();
if (comboboxRole == roles::COMBOBOX ||
comboboxRole == roles::AUTOCOMPLETE) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(combobox, states::EXPANDED, true);
if (event)
nsEventShell::FireEvent(event);
@@ -645,7 +645,7 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
// Fire expanded state change event.
if (notifyOf & kNotifyOfState) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccStateChangeEvent(widget, states::EXPANDED, false);
document->FireDelayedEvent(event);
}
+1 -1
View File
@@ -68,7 +68,7 @@ HTMLLabelAccessible::RelationByType(RelationType aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType == RelationType::LABEL_FOR) {
nsRefPtr<dom::HTMLLabelElement> label = dom::HTMLLabelElement::FromContent(mContent);
RefPtr<dom::HTMLLabelElement> label = dom::HTMLLabelElement::FromContent(mContent);
rel.AppendTarget(mDoc, label->GetControl());
}
@@ -134,7 +134,7 @@ HTMLRadioButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet,
nsAutoString name;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
nsRefPtr<nsContentList> inputElms;
RefPtr<nsContentList> inputElms;
nsCOMPtr<nsIFormControl> formControlNode(do_QueryInterface(mContent));
dom::Element* formElm = formControlNode->GetFormElement();
@@ -529,7 +529,7 @@ HTMLFileInputAccessible::HandleAccEvent(AccEvent* aEvent)
event->GetState() == states::INVALID)) {
Accessible* button = GetChildAt(0);
if (button && button->Role() == roles::PUSHBUTTON) {
nsRefPtr<AccStateChangeEvent> childEvent =
RefPtr<AccStateChangeEvent> childEvent =
new AccStateChangeEvent(button, event->GetState(),
event->IsStateEnabled(), event->FromUserInput());
nsEventShell::FireEvent(childEvent);
+4 -4
View File
@@ -87,7 +87,7 @@ HTMLImageMapAccessible::UpdateChildAreas(bool aDoFireEvents)
bool treeChanged = false;
AutoTreeMutation mut(this);
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(this);
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(this);
// Remove areas that are not a valid part of the image map anymore.
for (int32_t childIdx = mChildren.Length() - 1; childIdx >= 0; childIdx--) {
@@ -96,7 +96,7 @@ HTMLImageMapAccessible::UpdateChildAreas(bool aDoFireEvents)
continue;
if (aDoFireEvents) {
nsRefPtr<AccHideEvent> event = new AccHideEvent(area, area->GetContent());
RefPtr<AccHideEvent> event = new AccHideEvent(area, area->GetContent());
mDoc->FireDelayedEvent(event);
reorderEvent->AddSubMutationEvent(event);
}
@@ -112,7 +112,7 @@ HTMLImageMapAccessible::UpdateChildAreas(bool aDoFireEvents)
Accessible* area = mChildren.SafeElementAt(idx);
if (!area || area->GetContent() != areaContent) {
nsRefPtr<Accessible> area = new HTMLAreaAccessible(areaContent, mDoc);
RefPtr<Accessible> area = new HTMLAreaAccessible(areaContent, mDoc);
mDoc->BindToDocument(area, aria::GetRoleMap(areaContent));
if (!InsertChildAt(idx, area)) {
@@ -121,7 +121,7 @@ HTMLImageMapAccessible::UpdateChildAreas(bool aDoFireEvents)
}
if (aDoFireEvents) {
nsRefPtr<AccShowEvent> event = new AccShowEvent(area, areaContent);
RefPtr<AccShowEvent> event = new AccShowEvent(area, areaContent);
mDoc->FireDelayedEvent(event);
reorderEvent->AddSubMutationEvent(event);
}
+3 -3
View File
@@ -102,7 +102,7 @@ HTMLLIAccessible::UpdateBullet(bool aHasBullet)
return;
}
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(this);
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(this);
AutoTreeMutation mut(this);
DocAccessible* document = Document();
@@ -111,11 +111,11 @@ HTMLLIAccessible::UpdateBullet(bool aHasBullet)
document->BindToDocument(mBullet, nullptr);
InsertChildAt(0, mBullet);
nsRefPtr<AccShowEvent> event = new AccShowEvent(mBullet, mBullet->GetContent());
RefPtr<AccShowEvent> event = new AccShowEvent(mBullet, mBullet->GetContent());
mDoc->FireDelayedEvent(event);
reorderEvent->AddSubMutationEvent(event);
} else {
nsRefPtr<AccHideEvent> event = new AccHideEvent(mBullet, mBullet->GetContent());
RefPtr<AccHideEvent> event = new AccHideEvent(mBullet, mBullet->GetContent());
mDoc->FireDelayedEvent(event);
reorderEvent->AddSubMutationEvent(event);
+1 -1
View File
@@ -64,7 +64,7 @@ protected:
virtual void CacheChildren() override;
private:
nsRefPtr<HTMLListBulletAccessible> mBullet;
RefPtr<HTMLListBulletAccessible> mBullet;
};
+1 -1
View File
@@ -134,7 +134,7 @@ HTMLSelectListAccessible::CacheChildren()
nsGkAtoms::optgroup)) {
// Get an accessible for option or optgroup and cache it.
nsRefPtr<Accessible> accessible =
RefPtr<Accessible> accessible =
GetAccService()->GetOrCreateAccessible(childContent, this);
if (accessible)
AppendChild(accessible);
+1 -1
View File
@@ -196,7 +196,7 @@ protected:
Accessible* SelectedOption() const;
private:
nsRefPtr<HTMLComboboxListAccessible> mListAccessible;
RefPtr<HTMLComboboxListAccessible> mListAccessible;
};
/*
+2 -2
View File
@@ -812,7 +812,7 @@ HTMLTableAccessible::AddRowOrColumnToSelection(int32_t aIndex, uint32_t aTarget)
count = RowCount();
nsIPresShell* presShell(mDoc->PresShell());
nsRefPtr<nsFrameSelection> tableSelection =
RefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
for (uint32_t idx = 0; idx < count; idx++) {
@@ -838,7 +838,7 @@ HTMLTableAccessible::RemoveRowsOrColumnsFromSelection(int32_t aIndex,
return NS_OK;
nsIPresShell* presShell(mDoc->PresShell());
nsRefPtr<nsFrameSelection> tableSelection =
RefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
bool doUnselectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
+74 -15
View File
@@ -17,6 +17,9 @@
#include "nsIPersistentProperties2.h"
#include "nsISimpleEnumerator.h"
#include "nsAccUtils.h"
#ifdef MOZ_ACCESSIBILITY_ATK
#include "AccessibleWrap.h"
#endif
namespace mozilla {
namespace a11y {
@@ -378,13 +381,10 @@ DocAccessibleChild::RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
bool
DocAccessibleChild::RecvSetCaretOffset(const uint64_t& aID,
const int32_t& aOffset,
bool* aRetVal)
const int32_t& aOffset)
{
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
*aRetVal = false;
if (acc && acc->IsTextRole() && acc->IsValidOffset(aOffset)) {
*aRetVal = true;
acc->SetCaretOffset(aOffset);
}
return true;
@@ -476,6 +476,17 @@ DocAccessibleChild::RecvGetTextBeforeOffset(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvCharAt(const uint64_t& aID,
const int32_t& aOffset,
uint16_t* aChar)
{
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
*aChar = acc && acc->IsTextRole() ?
static_cast<uint16_t>(acc->CharAt(aOffset)) : 0;
return true;
}
bool
DocAccessibleChild::RecvTextAttributes(const uint64_t& aID,
const bool& aIncludeDefAttrs,
@@ -743,17 +754,6 @@ DocAccessibleChild::RecvPasteText(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvCharAt(const uint64_t& aID,
const int32_t& aOffset,
uint16_t* aChar)
{
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
*aChar = acc && acc->IsTextRole() ?
static_cast<uint16_t>(acc->CharAt(aOffset)) : 0;
return true;
}
bool
DocAccessibleChild::RecvImagePosition(const uint64_t& aID,
const uint32_t& aCoordType,
@@ -1444,6 +1444,52 @@ DocAccessibleChild::RecvTableIsProbablyForLayout(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvAtkTableColumnHeader(const uint64_t& aID,
const int32_t& aCol,
uint64_t* aHeader,
bool* aOk)
{
*aHeader = 0;
*aOk = false;
#ifdef MOZ_ACCESSIBILITY_ATK
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
Accessible* header = AccessibleWrap::GetColumnHeader(acc, aCol);
if (header) {
*aHeader = reinterpret_cast<uint64_t>(header->UniqueID());
*aOk = true;
}
}
#endif
return true;
}
bool
DocAccessibleChild::RecvAtkTableRowHeader(const uint64_t& aID,
const int32_t& aRow,
uint64_t* aHeader,
bool* aOk)
{
*aHeader = 0;
*aOk = false;
#ifdef MOZ_ACCESSIBILITY_ATK
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
Accessible* header = AccessibleWrap::GetRowHeader(acc, aRow);
if (header) {
*aHeader = reinterpret_cast<uint64_t>(header->UniqueID());
*aOk = true;
}
}
#endif
return true;
}
bool
DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
nsTArray<uint64_t>* aSelectedItemIDs)
@@ -1650,6 +1696,19 @@ DocAccessibleChild::RecvKeyboardShortcut(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvAtkKeyBinding(const uint64_t& aID,
nsString* aResult)
{
#ifdef MOZ_ACCESSIBILITY_ATK
Accessible* acc = IdToAccessible(aID);
if (acc) {
AccessibleWrap::GetKeyBinding(acc, *aResult);
}
#endif
return true;
}
bool
DocAccessibleChild::RecvCurValue(const uint64_t& aID,
double* aValue)
+31 -11
View File
@@ -48,6 +48,15 @@ public:
SendShutdown();
}
virtual void ActorDestroy(ActorDestroyReason) override
{
if (!mDoc)
return;
mDoc->SetIPCDoc(nullptr);
mDoc = nullptr;
}
void ShowEvent(AccShowEvent* aShowEvent);
/*
@@ -94,8 +103,8 @@ public:
override;
virtual bool RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
override;
virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset,
bool* aValid) override;
virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset)
override;
virtual bool RecvCharacterCount(const uint64_t& aID, int32_t* aCount)
override;
@@ -123,6 +132,10 @@ public:
nsString* aText, int32_t* aStartOffset,
int32_t* aEndOffset) override;
virtual bool RecvCharAt(const uint64_t& aID,
const int32_t& aOffset,
uint16_t* aChar) override;
virtual bool RecvTextAttributes(const uint64_t& aID,
const bool& aIncludeDefAttrs,
const int32_t& aOffset,
@@ -211,10 +224,6 @@ public:
virtual bool RecvPasteText(const uint64_t& aID,
const int32_t& aPosition, bool* aValid) override;
virtual bool RecvCharAt(const uint64_t& aID,
const int32_t& aOffset,
uint16_t* aChar) override;
virtual bool RecvImagePosition(const uint64_t& aID,
const uint32_t& aCoordType,
nsIntPoint* aRetVal) override;
@@ -354,6 +363,14 @@ public:
const uint32_t& aRow) override;
virtual bool RecvTableIsProbablyForLayout(const uint64_t& aID,
bool* aForLayout) override;
virtual bool RecvAtkTableColumnHeader(const uint64_t& aID,
const int32_t& aCol,
uint64_t* aHeader,
bool* aOk) override;
virtual bool RecvAtkTableRowHeader(const uint64_t& aID,
const int32_t& aRow,
uint64_t* aHeader,
bool* aOk) override;
virtual bool RecvSelectedItems(const uint64_t& aID,
nsTArray<uint64_t>* aSelectedItemIDs) override;
@@ -407,21 +424,24 @@ public:
uint32_t* aKey,
uint32_t* aModifierMask) override;
virtual bool RecvAtkKeyBinding(const uint64_t& aID,
nsString* aResult) override;
virtual bool RecvCurValue(const uint64_t& aID,
double* aValue);
double* aValue) override;
virtual bool RecvSetCurValue(const uint64_t& aID,
const double& aValue,
bool* aRetVal);
bool* aRetVal) override;
virtual bool RecvMinValue(const uint64_t& aID,
double* aValue);
double* aValue) override;
virtual bool RecvMaxValue(const uint64_t& aID,
double* aValue);
double* aValue) override;
virtual bool RecvStep(const uint64_t& aID,
double* aStep);
double* aStep) override;
virtual bool RecvTakeFocus(const uint64_t& aID) override;
+6 -1
View File
@@ -92,7 +92,7 @@ child:
// TextSubstring is getText in IDL.
prio(high) sync CaretLineNumber(uint64_t aID) returns(int32_t aLineNumber);
prio(high) sync CaretOffset(uint64_t aID) returns(int32_t aOffset);
prio(high) sync SetCaretOffset(uint64_t aID, int32_t aOffset) returns (bool aValid);
async SetCaretOffset(uint64_t aID, int32_t aOffset);
prio(high) sync CharacterCount(uint64_t aID) returns(int32_t aCount);
prio(high) sync SelectionCount(uint64_t aID) returns(int32_t aCount);
prio(high) sync TextSubstring(uint64_t aID, int32_t aStartOffset, int32_t
@@ -202,6 +202,10 @@ child:
prio(high) sync TableUnselectColumn(uint64_t aID, uint32_t aCol);
prio(high) sync TableUnselectRow(uint64_t aID, uint32_t aRow);
prio(high) sync TableIsProbablyForLayout(uint64_t aID) returns(bool aForLayout);
prio(high) sync AtkTableColumnHeader(uint64_t aID, int32_t aCol)
returns(uint64_t aHeaderID, bool aOk);
prio(high) sync AtkTableRowHeader(uint64_t aID, int32_t aRow)
returns(uint64_t aHeaderID, bool aOk);
prio(high) sync SelectedItems(uint64_t aID) returns(uint64_t[] aSelectedItemIDs);
prio(high) sync SelectedItemCount(uint64_t aID) returns(uint32_t aCount);
@@ -218,6 +222,7 @@ child:
prio(high) sync ActionNameAt(uint64_t aID, uint8_t aIndex) returns(nsString aName);
prio(high) sync AccessKey(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
prio(high) sync KeyboardShortcut(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
prio(high) sync AtkKeyBinding(uint64_t aID) returns(nsString aResult);
prio(high) sync CurValue(uint64_t aID) returns(double aValue);
prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal);
+34 -12
View File
@@ -215,12 +215,10 @@ ProxyAccessible::CaretOffset()
return offset;
}
bool
void
ProxyAccessible::SetCaretOffset(int32_t aOffset)
{
bool valid = false;
unused << mDoc->SendSetCaretOffset(mID, aOffset, &valid);
return valid;
unused << mDoc->SendSetCaretOffset(mID, aOffset);
}
int32_t
@@ -278,6 +276,14 @@ ProxyAccessible::GetTextBeforeOffset(int32_t aOffset,
&aText, aStartOffset, aEndOffset);
}
char16_t
ProxyAccessible::CharAt(int32_t aOffset)
{
uint16_t retval = 0;
unused << mDoc->SendCharAt(mID, aOffset, &retval);
return static_cast<char16_t>(retval);
}
void
ProxyAccessible::TextAttributes(bool aIncludeDefAttrs,
int32_t aOffset,
@@ -431,14 +437,6 @@ ProxyAccessible::PasteText(int32_t aPosition)
return valid;
}
char16_t
ProxyAccessible::CharAt(int32_t aOffset)
{
uint16_t retval = 0;
unused << mDoc->SendCharAt(mID, aOffset, &retval);
return static_cast<char16_t>(retval);
}
nsIntPoint
ProxyAccessible::ImagePosition(uint32_t aCoordType)
{
@@ -819,6 +817,24 @@ ProxyAccessible::TableIsProbablyForLayout()
return forLayout;
}
ProxyAccessible*
ProxyAccessible::AtkTableColumnHeader(int32_t aCol)
{
uint64_t headerID = 0;
bool ok = false;
unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok);
return ok ? mDoc->GetAccessible(headerID) : nullptr;
}
ProxyAccessible*
ProxyAccessible::AtkTableRowHeader(int32_t aRow)
{
uint64_t headerID = 0;
bool ok = false;
unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
return ok ? mDoc->GetAccessible(headerID) : nullptr;
}
void
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
{
@@ -933,6 +949,12 @@ ProxyAccessible::KeyboardShortcut()
return KeyBinding(key, modifierMask);
}
void
ProxyAccessible::AtkKeyBinding(nsString& aBinding)
{
unused << mDoc->SendAtkKeyBinding(mID, &aBinding);
}
double
ProxyAccessible::CurValue()
{
+4 -1
View File
@@ -132,7 +132,7 @@ public:
int32_t CaretLineNumber();
int32_t CaretOffset();
bool SetCaretOffset(int32_t aOffset);
void SetCaretOffset(int32_t aOffset);
int32_t CharacterCount();
int32_t SelectionCount();
@@ -282,6 +282,8 @@ public:
void TableUnselectColumn(uint32_t aCol);
void TableUnselectRow(uint32_t aRow);
bool TableIsProbablyForLayout();
ProxyAccessible* AtkTableColumnHeader(int32_t aCol);
ProxyAccessible* AtkTableRowHeader(int32_t aRow);
void SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems);
uint32_t SelectedItemCount();
@@ -298,6 +300,7 @@ public:
void ActionNameAt(uint8_t aIndex, nsString& aName);
KeyBinding AccessKey();
KeyBinding KeyboardShortcut();
void AtkKeyBinding(nsString& aBinding);
double CurValue();
bool SetCurValue(double aValue);
+6 -6
View File
@@ -117,12 +117,12 @@ ia2Accessible::get_relation(long aRelationIndex,
continue;
if (static_cast<size_t>(aRelationIndex) == i) {
nsTArray<nsRefPtr<Accessible>> targets;
nsTArray<RefPtr<Accessible>> targets;
size_t targetCount = targetSets[i].Length();
for (size_t j = 0; j < targetCount; j++)
targets.AppendElement(WrapperFor(targetSets[i][j]));
nsRefPtr<ia2AccessibleRelation> rel =
RefPtr<ia2AccessibleRelation> rel =
new ia2AccessibleRelation(types[i], Move(targets));
rel.forget(aRelation);
return S_OK;
@@ -139,7 +139,7 @@ ia2Accessible::get_relation(long aRelationIndex,
RelationType relationType = sRelationTypePairs[idx].first;
Relation rel = acc->RelationByType(relationType);
nsRefPtr<ia2AccessibleRelation> ia2Relation =
RefPtr<ia2AccessibleRelation> ia2Relation =
new ia2AccessibleRelation(relationType, &rel);
if (ia2Relation->HasTargets()) {
if (relIdx == aRelationIndex) {
@@ -185,11 +185,11 @@ ia2Accessible::get_relations(long aMaxRelations,
continue;
size_t targetCount = targetSets[i].Length();
nsTArray<nsRefPtr<Accessible>> targets(targetCount);
nsTArray<RefPtr<Accessible>> targets(targetCount);
for (size_t j = 0; j < targetCount; j++)
targets.AppendElement(WrapperFor(targetSets[i][j]));
nsRefPtr<ia2AccessibleRelation> rel =
RefPtr<ia2AccessibleRelation> rel =
new ia2AccessibleRelation(types[i], Move(targets));
rel.forget(aRelation + i);
i++;
@@ -206,7 +206,7 @@ ia2Accessible::get_relations(long aMaxRelations,
RelationType relationType = sRelationTypePairs[idx].first;
Relation rel = acc->RelationByType(relationType);
nsRefPtr<ia2AccessibleRelation> ia2Rel =
RefPtr<ia2AccessibleRelation> ia2Rel =
new ia2AccessibleRelation(relationType, &rel);
if (ia2Rel->HasTargets()) {
ia2Rel.forget(aRelation + (*aNRelations));
@@ -25,7 +25,7 @@ public:
ia2AccessibleRelation(RelationType aType, Relation* aRel);
ia2AccessibleRelation(RelationType aType,
nsTArray<nsRefPtr<Accessible>>&& aTargets) :
nsTArray<RefPtr<Accessible>>&& aTargets) :
mType(aType), mTargets(Move(aTargets)) {}
// IUnknown
@@ -59,7 +59,7 @@ private:
ia2AccessibleRelation& operator = (const ia2AccessibleRelation&);
RelationType mType;
nsTArray<nsRefPtr<Accessible> > mTargets;
nsTArray<RefPtr<Accessible> > mTargets;
};
+2 -1
View File
@@ -427,7 +427,8 @@ ia2AccessibleText::setCaretOffset(long aOffset)
A11Y_TRYBLOCK_BEGIN
if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
return proxy->SetCaretOffset(aOffset) ? S_OK : E_INVALIDARG;
proxy->SetCaretOffset(aOffset);
return S_OK;
}
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+1 -1
View File
@@ -805,7 +805,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
SelectedItems(&selectedItems);
// 1) Create and initialize the enumeration
nsRefPtr<AccessibleEnumerator> pEnum = new AccessibleEnumerator(selectedItems);
RefPtr<AccessibleEnumerator> pEnum = new AccessibleEnumerator(selectedItems);
pvarChildren->vt = VT_UNKNOWN; // this must be VT_UNKNOWN for an IEnumVARIANT
NS_ADDREF(pvarChildren->punkVal = pEnum);
}
+1 -1
View File
@@ -49,7 +49,7 @@ private:
virtual ~ChildrenEnumVariant() { }
protected:
nsRefPtr<AccessibleWrap> mAnchorAcc;
RefPtr<AccessibleWrap> mAnchorAcc;
Accessible* mCurAcc;
uint32_t mCurIndex;
};
@@ -37,7 +37,7 @@ protected:
virtual void CacheChildren();
void* mHwnd;
nsRefPtr<Accessible> mNativeAccessible;
RefPtr<Accessible> mNativeAccessible;
};
/**
+1 -1
View File
@@ -29,7 +29,7 @@ public:
void** aInstancePtr);
private:
nsRefPtr<AccessibleWrap> mAccessible;
RefPtr<AccessibleWrap> mAccessible;
};
}
+1 -1
View File
@@ -44,7 +44,7 @@ public:
/* [in] */ BSTR __RPC_FAR *commaSeparatedMediaTypes);
protected:
nsRefPtr<DocAccessibleWrap> mAccessible;
RefPtr<DocAccessibleWrap> mAccessible;
};
} // namespace a11y
+2 -2
View File
@@ -148,7 +148,7 @@ sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex,
if (mAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsRefPtr<nsRange> range = new nsRange(mAccessible->GetContent());
RefPtr<nsRange> range = new nsRange(mAccessible->GetContent());
if (NS_FAILED(range->SetStart(mAccessible->GetContent(), aStartIndex)))
return E_FAIL;
@@ -179,7 +179,7 @@ sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily)
if (!frame)
return E_FAIL;
nsRefPtr<nsFontMetrics> fm;
RefPtr<nsFontMetrics> fm;
nsLayoutUtils::GetFontMetricsForFrame(frame, getter_AddRefs(fm));
const nsString& name =
+1 -1
View File
@@ -62,7 +62,7 @@ private:
int32_t aOffset, bool aPreferNext,
nsPoint& aOutPoint);
nsRefPtr<AccessibleWrap> mAccessible;
RefPtr<AccessibleWrap> mAccessible;
};
} // namespace a11y
+1 -1
View File
@@ -66,7 +66,7 @@ private:
uiaRawElmProvider(const uiaRawElmProvider&) = delete;
protected:
nsRefPtr<AccessibleWrap> mAcc;
RefPtr<AccessibleWrap> mAcc;
};
} // a11y namespace
+1 -1
View File
@@ -196,7 +196,7 @@ xpcAccessibleDocument::GetAccessible(Accessible* aAccessible)
}
static PLDHashOperator
ShutdownAndRemove(const Accessible* aKey, nsRefPtr<xpcAccessibleGeneric>& aValue,
ShutdownAndRemove(const Accessible* aKey, RefPtr<xpcAccessibleGeneric>& aValue,
void* aUnused)
{
aValue->Shutdown();
+1 -1
View File
@@ -59,7 +59,7 @@ xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI)
if (aIndex < 0 || aIndex >= static_cast<int32_t>(Intl()->AnchorCount()))
return NS_ERROR_INVALID_ARG;
nsRefPtr<nsIURI>(Intl()->AnchorURIAt(aIndex)).forget(aURI);
RefPtr<nsIURI>(Intl()->AnchorURIAt(aIndex)).forget(aURI);
return NS_OK;
}
+3 -3
View File
@@ -347,7 +347,7 @@ xpcAccessibleHyperText::GetEnclosingRange(nsIAccessibleTextRange** aRange)
if (!Intl())
return NS_ERROR_FAILURE;
nsRefPtr<xpcAccessibleTextRange> range = new xpcAccessibleTextRange;
RefPtr<xpcAccessibleTextRange> range = new xpcAccessibleTextRange;
Intl()->EnclosingRange(range->mRange);
NS_ASSERTION(range->mRange.IsValid(),
"Should always have an enclosing range!");
@@ -419,7 +419,7 @@ xpcAccessibleHyperText::GetRangeByChild(nsIAccessible* aChild,
Accessible* child = aChild->ToInternalAccessible();
if (child) {
nsRefPtr<xpcAccessibleTextRange> range = new xpcAccessibleTextRange;
RefPtr<xpcAccessibleTextRange> range = new xpcAccessibleTextRange;
Intl()->RangeByChild(child, range->mRange);
if (range->mRange.IsValid())
range.forget(aRange);
@@ -438,7 +438,7 @@ xpcAccessibleHyperText::GetRangeAtPoint(int32_t aX, int32_t aY,
if (!Intl())
return NS_ERROR_FAILURE;
nsRefPtr<xpcAccessibleTextRange> range = new xpcAccessibleTextRange;
RefPtr<xpcAccessibleTextRange> range = new xpcAccessibleTextRange;
Intl()->RangeAtPoint(aX, aY, range->mRange);
if (range->mRange.IsValid())
range.forget(aRange);
+2 -2
View File
@@ -99,7 +99,7 @@ xpcAccessibleTextRange::Compare(nsIAccessibleTextRange* aOtherRange,
bool* aResult)
{
nsRefPtr<xpcAccessibleTextRange> xpcRange(do_QueryObject(aOtherRange));
RefPtr<xpcAccessibleTextRange> xpcRange(do_QueryObject(aOtherRange));
if (!xpcRange || !aResult)
return NS_ERROR_INVALID_ARG;
@@ -113,7 +113,7 @@ xpcAccessibleTextRange::CompareEndPoints(uint32_t aEndPoint,
uint32_t aOtherRangeEndPoint,
int32_t* aResult)
{
nsRefPtr<xpcAccessibleTextRange> xpcRange(do_QueryObject(aOtherRange));
RefPtr<xpcAccessibleTextRange> xpcRange(do_QueryObject(aOtherRange));
if (!xpcRange || !aResult)
return NS_ERROR_INVALID_ARG;
+1 -1
View File
@@ -36,7 +36,7 @@ protected:
virtual void CacheChildren() override;
private:
nsRefPtr<XULLabelTextLeafAccessible> mValueTextLeaf;
RefPtr<XULLabelTextLeafAccessible> mValueTextLeaf;
};
inline XULLabelAccessible*
+7 -7
View File
@@ -167,7 +167,7 @@ XULTreeAccessible::NativeRole()
if (!treeFrame)
return roles::LIST;
nsRefPtr<nsTreeColumns> cols = treeFrame->Columns();
RefPtr<nsTreeColumns> cols = treeFrame->Columns();
nsCOMPtr<nsITreeColumn> primaryCol;
cols->GetPrimaryColumn(getter_AddRefs(primaryCol));
@@ -210,7 +210,7 @@ XULTreeAccessible::ChildAtPoint(int32_t aX, int32_t aY,
Accessible* child = GetTreeItemAccessible(row);
if (aWhichChild == eDeepestChild && child) {
// Look for accessible cell for the found item accessible.
nsRefPtr<XULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
RefPtr<XULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
Accessible* cell = treeitem->GetCellAccessible(column);
if (cell)
@@ -533,7 +533,7 @@ XULTreeAccessible::GetTreeItemAccessible(int32_t aRow) const
if (cachedTreeItem)
return cachedTreeItem;
nsRefPtr<Accessible> treeItem = CreateTreeItemAccessible(aRow);
RefPtr<Accessible> treeItem = CreateTreeItemAccessible(aRow);
if (treeItem) {
mAccessibleCache.Put(key, treeItem);
Document()->BindToDocument(treeItem, nullptr);
@@ -568,7 +568,7 @@ XULTreeAccessible::InvalidateCache(int32_t aRow, int32_t aCount)
Accessible* treeItem = mAccessibleCache.GetWeak(key);
if (treeItem) {
nsRefPtr<AccEvent> event =
RefPtr<AccEvent> event =
new AccEvent(nsIAccessibleEvent::EVENT_HIDE, treeItem);
nsEventShell::FireEvent(event);
@@ -648,7 +648,7 @@ XULTreeAccessible::TreeViewInvalidated(int32_t aStartRow, int32_t aEndRow,
Accessible* accessible = mAccessibleCache.GetWeak(key);
if (accessible) {
nsRefPtr<XULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
RefPtr<XULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
NS_ASSERTION(treeitemAcc, "Wrong accessible at the given key!");
treeitemAcc->RowInvalidated(aStartCol, endCol);
@@ -665,7 +665,7 @@ XULTreeAccessible::TreeViewChanged(nsITreeView* aView)
// Fire reorder event on tree accessible on accessible tree (do not fire
// show/hide events on tree items because it can be expensive to fire them for
// each tree item.
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(this);
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(this);
Document()->FireDelayedEvent(reorderEvent);
// Clear cache.
@@ -681,7 +681,7 @@ XULTreeAccessible::TreeViewChanged(nsITreeView* aView)
already_AddRefed<Accessible>
XULTreeAccessible::CreateTreeItemAccessible(int32_t aRow) const
{
nsRefPtr<Accessible> accessible =
RefPtr<Accessible> accessible =
new XULTreeItemAccessible(mContent, mDoc, const_cast<XULTreeAccessible*>(this),
mTree, mTreeView, aRow);
+5 -5
View File
@@ -128,7 +128,7 @@ XULTreeGridAccessible::CellAt(uint32_t aRowIndex, uint32_t aColumnIndex)
if (!column)
return nullptr;
nsRefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
RefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
if (!rowAcc)
return nullptr;
@@ -228,7 +228,7 @@ XULTreeGridAccessible::NativeRole()
already_AddRefed<Accessible>
XULTreeGridAccessible::CreateTreeItemAccessible(int32_t aRow) const
{
nsRefPtr<Accessible> accessible =
RefPtr<Accessible> accessible =
new XULTreeGridRowAccessible(mContent, mDoc,
const_cast<XULTreeGridAccessible*>(this),
mTree, mTreeView, aRow);
@@ -376,7 +376,7 @@ XULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn) const
if (cachedCell)
return cachedCell;
nsRefPtr<XULTreeGridCellAccessible> cell =
RefPtr<XULTreeGridCellAccessible> cell =
new XULTreeGridCellAccessibleWrap(mContent, mDoc,
const_cast<XULTreeGridRowAccessible*>(this),
mTree, mTreeView, mRow, aColumn);
@@ -737,7 +737,7 @@ XULTreeGridCellAccessible::CellInvalidated()
mTreeView->GetCellValue(mRow, mColumn, textEquiv);
if (mCachedTextEquiv != textEquiv) {
bool isEnabled = textEquiv.EqualsLiteral("true");
nsRefPtr<AccEvent> accEvent =
RefPtr<AccEvent> accEvent =
new AccStateChangeEvent(this, states::CHECKED, isEnabled);
nsEventShell::FireEvent(accEvent);
@@ -784,7 +784,7 @@ XULTreeGridCellAccessible::GetSiblingAtOffset(int32_t aOffset,
if (!columnAtOffset)
return nullptr;
nsRefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent());
RefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent());
return rowAcc->GetCellAccessible(columnAtOffset);
}
+2
View File
@@ -413,6 +413,8 @@
@RESPATH@/components/AlarmsManager.manifest
@RESPATH@/components/FeedProcessor.manifest
@RESPATH@/components/FeedProcessor.js
@RESPATH@/components/PackagedAppUtils.manifest
@RESPATH@/components/PackagedAppUtils.js
@RESPATH@/components/BrowserFeeds.manifest
@RESPATH@/components/FeedConverter.js
@RESPATH@/components/FeedWriter.js
@@ -28,8 +28,8 @@ private:
*/
void EnsureInitialized();
nsRefPtr<IUrlHistoryStg2> mIEHistory;
nsRefPtr<IEnumSTATURL> mURLEnumerator;
RefPtr<IUrlHistoryStg2> mIEHistory;
RefPtr<IEnumSTATURL> mURLEnumerator;
nsCOMPtr<nsIWritablePropertyBag2> mCachedNextEntry;
};
+2
View File
@@ -386,6 +386,8 @@
@RESPATH@/components/BrowserElementParent.js
@RESPATH@/components/FeedProcessor.manifest
@RESPATH@/components/FeedProcessor.js
@RESPATH@/components/PackagedAppUtils.js
@RESPATH@/components/PackagedAppUtils.manifest
@RESPATH@/browser/components/BrowserFeeds.manifest
@RESPATH@/browser/components/FeedConverter.js
@RESPATH@/browser/components/FeedWriter.js
+2 -2
View File
@@ -433,12 +433,12 @@ BasePrincipal::CreateCodebasePrincipal(nsIURI* aURI, const OriginAttributes& aAt
if (!principal) {
return nsNullPrincipal::Create();
}
nsRefPtr<BasePrincipal> concrete = Cast(principal);
RefPtr<BasePrincipal> concrete = Cast(principal);
return concrete.forget();
}
// Mint a codebase principal.
nsRefPtr<nsPrincipal> codebase = new nsPrincipal();
RefPtr<nsPrincipal> codebase = new nsPrincipal();
rv = codebase->Init(aURI, aAttrs);
NS_ENSURE_SUCCESS(rv, nullptr);
return codebase.forget();
+4 -4
View File
@@ -61,10 +61,10 @@ public:
private:
virtual ~DomainPolicy();
nsRefPtr<DomainSet> mBlacklist;
nsRefPtr<DomainSet> mSuperBlacklist;
nsRefPtr<DomainSet> mWhitelist;
nsRefPtr<DomainSet> mSuperWhitelist;
RefPtr<DomainSet> mBlacklist;
RefPtr<DomainSet> mSuperBlacklist;
RefPtr<DomainSet> mWhitelist;
RefPtr<DomainSet> mSuperWhitelist;
};
} /* namespace mozilla */
+2 -2
View File
@@ -38,7 +38,7 @@ NS_IMPL_CI_INTERFACE_GETTER(nsNullPrincipal,
/* static */ already_AddRefed<nsNullPrincipal>
nsNullPrincipal::CreateWithInheritedAttributes(nsIPrincipal* aInheritFrom)
{
nsRefPtr<nsNullPrincipal> nullPrin = new nsNullPrincipal();
RefPtr<nsNullPrincipal> nullPrin = new nsNullPrincipal();
nsresult rv = nullPrin->Init(Cast(aInheritFrom)->OriginAttributesRef());
return NS_SUCCEEDED(rv) ? nullPrin.forget() : nullptr;
}
@@ -46,7 +46,7 @@ nsNullPrincipal::CreateWithInheritedAttributes(nsIPrincipal* aInheritFrom)
/* static */ already_AddRefed<nsNullPrincipal>
nsNullPrincipal::Create(const OriginAttributes& aOriginAttributes)
{
nsRefPtr<nsNullPrincipal> nullPrin = new nsNullPrincipal();
RefPtr<nsNullPrincipal> nullPrin = new nsNullPrincipal();
nsresult rv = nullPrin->Init(aOriginAttributes);
NS_ENSURE_SUCCESS(rv, nullptr);
+1 -1
View File
@@ -54,7 +54,7 @@ nsNullPrincipalURI::Init()
already_AddRefed<nsNullPrincipalURI>
nsNullPrincipalURI::Create()
{
nsRefPtr<nsNullPrincipalURI> uri = new nsNullPrincipalURI();
RefPtr<nsNullPrincipalURI> uri = new nsNullPrincipalURI();
nsresult rv = uri->Init();
NS_ENSURE_SUCCESS(rv, nullptr);
return uri.forget();
+3 -3
View File
@@ -325,7 +325,7 @@ nsScriptSecurityManager::GetChannelResultPrincipal(nsIChannel* aChannel,
aChannel->GetLoadInfo(getter_AddRefs(loadInfo));
if (loadInfo) {
if (loadInfo->GetLoadingSandboxed()) {
nsRefPtr<nsNullPrincipal> prin =
RefPtr<nsNullPrincipal> prin =
nsNullPrincipal::CreateWithInheritedAttributes(loadInfo->LoadingPrincipal());
NS_ENSURE_TRUE(prin, NS_ERROR_FAILURE);
prin.forget(aPrincipal);
@@ -1312,7 +1312,7 @@ nsresult nsScriptSecurityManager::Init()
NS_ENSURE_SUCCESS(rv, rv);
// Create our system principal singleton
nsRefPtr<nsSystemPrincipal> system = new nsSystemPrincipal();
RefPtr<nsSystemPrincipal> system = new nsSystemPrincipal();
mSystemPrincipal = system;
@@ -1371,7 +1371,7 @@ nsScriptSecurityManager::GetScriptSecurityManager()
/* static */ void
nsScriptSecurityManager::InitStatics()
{
nsRefPtr<nsScriptSecurityManager> ssManager = new nsScriptSecurityManager();
RefPtr<nsScriptSecurityManager> ssManager = new nsScriptSecurityManager();
nsresult rv = ssManager->Init();
if (NS_FAILED(rv)) {
MOZ_CRASH();
+1 -1
View File
@@ -76,7 +76,7 @@ nsChromeProtocolHandler::NewURI(const nsACString &aSpec,
// Chrome: URLs (currently) have no additional structure beyond that provided
// by standard URLs, so there is no "outer" given to CreateInstance
nsRefPtr<nsStandardURL> surl = new nsStandardURL();
RefPtr<nsStandardURL> surl = new nsStandardURL();
nsresult rv = surl->Init(nsIStandardURL::URLTYPE_STANDARD, -1, aSpec,
aCharset, aBaseURI);
+5 -5
View File
@@ -423,7 +423,7 @@ nsresult nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow)
if (IsChromeURI(uri)) {
// Reload the sheet.
nsRefPtr<CSSStyleSheet> newSheet;
RefPtr<CSSStyleSheet> newSheet;
rv = document->LoadChromeSheetSync(uri, true,
getter_AddRefs(newSheet));
if (NS_FAILED(rv)) return rv;
@@ -462,12 +462,12 @@ nsresult nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow)
// Iterate over our old sheets and kick off a sync load of the new
// sheet if and only if it's a chrome URL.
for (i = 0; i < count; i++) {
nsRefPtr<CSSStyleSheet> sheet = do_QueryObject(oldSheets[i]);
RefPtr<CSSStyleSheet> sheet = do_QueryObject(oldSheets[i]);
nsIURI* uri = sheet ? sheet->GetOriginalURI() : nullptr;
if (uri && IsChromeURI(uri)) {
// Reload the sheet.
nsRefPtr<CSSStyleSheet> newSheet;
RefPtr<CSSStyleSheet> newSheet;
// XXX what about chrome sheets that have a title or are disabled? This
// only works by sheer dumb luck.
document->LoadChromeSheetSync(uri, false, getter_AddRefs(newSheet));
@@ -686,11 +686,11 @@ already_AddRefed<nsChromeRegistry>
nsChromeRegistry::GetSingleton()
{
if (gChromeRegistry) {
nsRefPtr<nsChromeRegistry> registry = gChromeRegistry;
RefPtr<nsChromeRegistry> registry = gChromeRegistry;
return registry.forget();
}
nsRefPtr<nsChromeRegistry> cr;
RefPtr<nsChromeRegistry> cr;
if (GeckoProcessType_Content == XRE_GetProcessType())
cr = new nsChromeRegistryContent();
else
+1 -1
View File
@@ -185,6 +185,6 @@ nsAboutRedirector::GetIndexedDBOriginPostfix(nsIURI* aURI, nsAString& aResult)
nsresult
nsAboutRedirector::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
{
nsRefPtr<nsAboutRedirector> about = new nsAboutRedirector();
RefPtr<nsAboutRedirector> about = new nsAboutRedirector();
return about->QueryInterface(aIID, aResult);
}
+2 -2
View File
@@ -122,7 +122,7 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType,
aContentType.EqualsLiteral("image/jpeg");
if (mExistingJPEGStreamListener && reuseCV) {
nsRefPtr<nsIStreamListener> copy(mExistingJPEGStreamListener);
RefPtr<nsIStreamListener> copy(mExistingJPEGStreamListener);
copy.forget(aContentHandler);
rv = NS_OK;
} else {
@@ -223,7 +223,7 @@ NS_IMETHODIMP
nsDSURIContentListener::SetLoadCookie(nsISupports* aLoadCookie)
{
#ifdef DEBUG
nsRefPtr<nsDocLoader> cookieAsDocLoader =
RefPtr<nsDocLoader> cookieAsDocLoader =
nsDocLoader::GetAsDocLoader(aLoadCookie);
NS_ASSERTION(cookieAsDocLoader && cookieAsDocLoader == mDocShell,
"Invalid load cookie being set!");
+2 -2
View File
@@ -173,7 +173,7 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
NS_ENSURE_TRUE(!uriString.IsEmpty(), NS_ERROR_FAILURE);
nsRefPtr<nsDefaultURIFixupInfo> info = new nsDefaultURIFixupInfo(uriString);
RefPtr<nsDefaultURIFixupInfo> info = new nsDefaultURIFixupInfo(uriString);
NS_ADDREF(*aInfo = info);
nsCOMPtr<nsIIOService> ioService =
@@ -450,7 +450,7 @@ nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
nsIInputStream** aPostData,
nsIURIFixupInfo** aInfo)
{
nsRefPtr<nsDefaultURIFixupInfo> info = new nsDefaultURIFixupInfo(aKeyword);
RefPtr<nsDefaultURIFixupInfo> info = new nsDefaultURIFixupInfo(aKeyword);
NS_ADDREF(*aInfo = info);
if (aPostData) {
+39 -45
View File
@@ -608,7 +608,7 @@ SendPing(void* aClosure, nsIContent* aContent, nsIURI* aURI,
loadGroup->SetNotificationCallbacks(callbacks);
chan->SetLoadGroup(loadGroup);
nsRefPtr<nsPingListener> pingListener = new nsPingListener();
RefPtr<nsPingListener> pingListener = new nsPingListener();
chan->AsyncOpen2(pingListener);
// Even if AsyncOpen failed, we still count this as a successful ping. It's
@@ -1834,7 +1834,7 @@ nsDocShell::GetPresContext(nsPresContext** aPresContext)
NS_IMETHODIMP_(nsIPresShell*)
nsDocShell::GetPresShell()
{
nsRefPtr<nsPresContext> presContext;
RefPtr<nsPresContext> presContext;
(void)GetPresContext(getter_AddRefs(presContext));
return presContext ? presContext->GetPresShell() : nullptr;
}
@@ -1847,7 +1847,7 @@ nsDocShell::GetEldestPresShell(nsIPresShell** aPresShell)
NS_ENSURE_ARG_POINTER(aPresShell);
*aPresShell = nullptr;
nsRefPtr<nsPresContext> presContext;
RefPtr<nsPresContext> presContext;
(void)GetEldestPresContext(getter_AddRefs(presContext));
if (presContext) {
@@ -2537,7 +2537,7 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed)
// If we have no parent then we're the root docshell; no ancestor of the
// original docshell doesn't have a allowfullscreen attribute, so
// report fullscreen as allowed.
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
if (!parent) {
*aFullscreenAllowed = true;
return NS_OK;
@@ -2603,7 +2603,7 @@ nsDocShell::GetDocShellEnumerator(int32_t aItemType, int32_t aDirection,
NS_ENSURE_ARG_POINTER(aResult);
*aResult = nullptr;
nsRefPtr<nsDocShellEnumerator> docShellEnum;
RefPtr<nsDocShellEnumerator> docShellEnum;
if (aDirection == ENUMERATE_FORWARDS) {
docShellEnum = new nsDocShellForwardsEnumerator;
} else {
@@ -2892,7 +2892,7 @@ nsDocShell::Now(DOMHighResTimeStamp* aWhen)
NS_IMETHODIMP
nsDocShell::SetWindowDraggingAllowed(bool aValue)
{
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
if (!aValue && mItemType == typeChrome && !parent) {
// Window dragging is always allowed for top level
// chrome docshells.
@@ -2908,7 +2908,7 @@ nsDocShell::GetWindowDraggingAllowed(bool* aValue)
// window dragging regions in CSS (-moz-window-drag:drag)
// can be slow. Default behavior is to only allow it for
// chrome top level windows.
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
if (mItemType == typeChrome && !parent) {
// Top level chrome window
*aValue = true;
@@ -2970,7 +2970,7 @@ nsDocShell::GetSessionStorageForPrincipal(nsIPrincipal* aPrincipal,
nsresult
nsDocShell::AddSessionStorage(nsIPrincipal* aPrincipal, nsIDOMStorage* aStorage)
{
nsRefPtr<DOMStorage> storage = static_cast<DOMStorage*>(aStorage);
RefPtr<DOMStorage> storage = static_cast<DOMStorage*>(aStorage);
if (!storage) {
return NS_ERROR_UNEXPECTED;
}
@@ -3149,7 +3149,7 @@ nsDocShell::SetItemType(int32_t aItemType)
// disable auth prompting for anything but content
mAllowAuth = mItemType == typeContent;
nsRefPtr<nsPresContext> presContext = nullptr;
RefPtr<nsPresContext> presContext = nullptr;
GetPresContext(getter_AddRefs(presContext));
if (presContext) {
presContext->UpdateIsChrome();
@@ -3182,7 +3182,7 @@ void
nsDocShell::RecomputeCanExecuteScripts()
{
bool old = mCanExecuteScripts;
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
// If we have no tree owner, that means that we've been detached from the
// docshell tree (this is distinct from having no parent dochshell, which
@@ -3347,8 +3347,8 @@ nsDocShell::GetRootTreeItem(nsIDocShellTreeItem** aRootTreeItem)
{
NS_ENSURE_ARG_POINTER(aRootTreeItem);
nsRefPtr<nsDocShell> root = this;
nsRefPtr<nsDocShell> parent = root->GetParentDocshell();
RefPtr<nsDocShell> root = this;
RefPtr<nsDocShell> parent = root->GetParentDocshell();
while (parent) {
root = parent;
parent = root->GetParentDocshell();
@@ -3740,7 +3740,7 @@ PrintDocTree(nsIDocShellTreeItem* aParentNode, int aLevel)
nsCOMPtr<nsIDocShell> parentAsDocShell(do_QueryInterface(aParentNode));
int32_t type = aParentNode->ItemType();
nsCOMPtr<nsIPresShell> presShell = parentAsDocShell->GetPresShell();
nsRefPtr<nsPresContext> presContext;
RefPtr<nsPresContext> presContext;
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
nsIDocument* doc = presShell->GetDocument();
@@ -3883,7 +3883,7 @@ nsDocShell::AddChild(nsIDocShellTreeItem* aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
nsRefPtr<nsDocLoader> childAsDocLoader = GetAsDocLoader(aChild);
RefPtr<nsDocLoader> childAsDocLoader = GetAsDocLoader(aChild);
NS_ENSURE_TRUE(childAsDocLoader, NS_ERROR_UNEXPECTED);
// Make sure we're not creating a loop in the docshell tree
@@ -3995,7 +3995,7 @@ nsDocShell::RemoveChild(nsIDocShellTreeItem* aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
nsRefPtr<nsDocLoader> childAsDocLoader = GetAsDocLoader(aChild);
RefPtr<nsDocLoader> childAsDocLoader = GetAsDocLoader(aChild);
NS_ENSURE_TRUE(childAsDocLoader, NS_ERROR_UNEXPECTED);
nsresult rv = RemoveChildLoader(childAsDocLoader);
@@ -4376,7 +4376,7 @@ nsDocShell::SetDeviceSizeIsPageSize(bool aValue)
{
if (mDeviceSizeIsPageSize != aValue) {
mDeviceSizeIsPageSize = aValue;
nsRefPtr<nsPresContext> presContext;
RefPtr<nsPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
if (presContext) {
presContext->MediaFeatureValuesChanged(nsRestyleHint(0));
@@ -5882,8 +5882,8 @@ nsDocShell::GetVisibility(bool* aVisibility)
// for a hidden view, unless we're an off screen browser, which
// would make this test meaningless.
nsRefPtr<nsDocShell> docShell = this;
nsRefPtr<nsDocShell> parentItem = docShell->GetParentDocshell();
RefPtr<nsDocShell> docShell = this;
RefPtr<nsDocShell> parentItem = docShell->GetParentDocshell();
while (parentItem) {
presShell = docShell->GetPresShell();
@@ -8216,7 +8216,7 @@ nsDocShell::RestorePresentation(nsISHEntry* aSHEntry, bool* aRestoring)
"should only have one RestorePresentationEvent");
mRestorePresentationEvent.Revoke();
nsRefPtr<RestorePresentationEvent> evt = new RestorePresentationEvent(this);
RefPtr<RestorePresentationEvent> evt = new RestorePresentationEvent(this);
nsresult rv = NS_DispatchToCurrentThread(evt);
if (NS_SUCCEEDED(rv)) {
mRestorePresentationEvent = evt.get();
@@ -8256,7 +8256,7 @@ public:
private:
nsRevocableEventPtr<nsDocShell::RestorePresentationEvent>&
mRestorePresentationEvent;
nsRefPtr<nsDocShell::RestorePresentationEvent> mEvent;
RefPtr<nsDocShell::RestorePresentationEvent> mEvent;
};
} // namespace
@@ -8329,7 +8329,7 @@ nsDocShell::RestoreFromHistory()
// to be consistent with normal document loading, subframes cannot start
// loading until after data arrives, which is after STATE_START completes.
nsRefPtr<RestorePresentationEvent> currentPresentationRestoration =
RefPtr<RestorePresentationEvent> currentPresentationRestoration =
mRestorePresentationEvent.get();
Stop();
// Make sure we're still restoring the same presentation.
@@ -8541,7 +8541,7 @@ nsDocShell::RestoreFromHistory()
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDoc);
uint32_t parentSuspendCount = 0;
if (document) {
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
if (parent) {
nsCOMPtr<nsIDocument> d = parent->GetDocument();
if (d) {
@@ -9381,7 +9381,7 @@ private:
nsXPIDLCString mTypeHint;
nsString mSrcdoc;
nsRefPtr<nsDocShell> mDocShell;
RefPtr<nsDocShell> mDocShell;
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIURI> mOriginalURI;
bool mLoadReplace;
@@ -9527,7 +9527,7 @@ nsDocShell::InternalLoad2(nsIURI* aURI,
requestingElement = mScriptGlobal->GetFrameElementInternal();
}
nsRefPtr<nsGlobalWindow> MMADeathGrip = mScriptGlobal;
RefPtr<nsGlobalWindow> MMADeathGrip = mScriptGlobal;
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
uint32_t contentType;
@@ -10082,7 +10082,7 @@ nsDocShell::InternalLoad2(nsIURI* aURI,
// applies to aURI.
CopyFavicon(currentURI, aURI, mInPrivateBrowsing);
nsRefPtr<nsGlobalWindow> win = mScriptGlobal ?
RefPtr<nsGlobalWindow> win = mScriptGlobal ?
mScriptGlobal->GetCurrentInnerWindowInternal() : nullptr;
// ScrollToAnchor doesn't necessarily cause us to scroll the window;
@@ -13093,7 +13093,7 @@ nsDocShell::GetNestedFrameId(uint64_t* aId)
NS_IMETHODIMP
nsDocShell::IsAppOfType(uint32_t aAppType, bool* aIsOfType)
{
nsRefPtr<nsDocShell> shell = this;
RefPtr<nsDocShell> shell = this;
while (shell) {
uint32_t type;
shell->GetAppType(&type);
@@ -13321,7 +13321,7 @@ public:
}
private:
nsRefPtr<nsDocShell> mHandler;
RefPtr<nsDocShell> mHandler;
nsCOMPtr<nsIURI> mURI;
nsString mTargetSpec;
nsString mFileName;
@@ -13849,7 +13849,7 @@ OriginAttributes
nsDocShell::GetOriginAttributes()
{
OriginAttributes attrs;
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
if (parent) {
attrs.InheritFromDocShellParent(parent->GetOriginAttributes());
}
@@ -13909,7 +13909,7 @@ nsDocShell::GetAsyncPanZoomEnabled(bool* aOut)
bool
nsDocShell::HasUnloadedParent()
{
nsRefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetParentDocshell();
while (parent) {
bool inUnload = false;
parent->GetIsInUnload(&inUnload);
@@ -14010,8 +14010,7 @@ nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
}
NS_IMETHODIMP
nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNavigate,
nsContentPolicyType aLoadContentType,
nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceRequest,
bool* aShouldIntercept)
{
*aShouldIntercept = false;
@@ -14030,7 +14029,7 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNavigate,
return NS_OK;
}
nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (!swm) {
return NS_OK;
}
@@ -14064,7 +14063,7 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNavigate,
}
}
if (aIsNavigate || nsContentUtils::IsWorkerLoad(aLoadContentType)) {
if (aIsNonSubresourceRequest) {
OriginAttributes attrs(GetAppId(), GetIsInBrowserElement());
*aShouldIntercept = swm->IsAvailable(attrs, aURI);
return NS_OK;
@@ -14113,7 +14112,7 @@ NS_IMPL_ISUPPORTS(FetchEventDispatcher, nsIFetchEventDispatcher)
NS_IMETHODIMP
FetchEventDispatcher::Dispatch()
{
nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (!swm) {
mChannel->Cancel(NS_ERROR_INTERCEPTION_FAILED);
return NS_OK;
@@ -14134,24 +14133,19 @@ NS_IMETHODIMP
nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel,
nsIFetchEventDispatcher** aFetchDispatcher)
{
nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (!swm) {
aChannel->Cancel(NS_ERROR_INTERCEPTION_FAILED);
return NS_OK;
}
bool isNavigation = false;
nsresult rv = aChannel->GetIsNavigation(&isNavigation);
NS_ENSURE_SUCCESS(rv, rv);
nsContentPolicyType loadType;
rv = aChannel->GetInternalContentPolicyType(&loadType);
nsCOMPtr<nsIChannel> channel;
nsresult rv = aChannel->GetChannel(getter_AddRefs(channel));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc;
bool isSubresourceLoad = !isNavigation &&
!nsContentUtils::IsWorkerLoad(loadType);
bool isSubresourceLoad = !nsContentUtils::IsNonSubresourceRequest(channel);
if (isSubresourceLoad) {
doc = GetDocument();
if (!doc) {
@@ -14171,7 +14165,7 @@ nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel,
}
MOZ_ASSERT(runnable);
nsRefPtr<FetchEventDispatcher> dispatcher =
RefPtr<FetchEventDispatcher> dispatcher =
new FetchEventDispatcher(aChannel, runnable);
dispatcher.forget(aFetchDispatcher);
@@ -14212,7 +14206,7 @@ nsDocShell::GetPaymentRequestId(nsAString& aPaymentRequestId)
bool
nsDocShell::InFrameSwap()
{
nsRefPtr<nsDocShell> shell = this;
RefPtr<nsDocShell> shell = this;
do {
if (shell->mInFrameSwap) {
return true;
+5 -5
View File
@@ -111,7 +111,7 @@ public:
int32_t GetDelay() { return mDelay ;}
nsRefPtr<nsDocShell> mDocShell;
RefPtr<nsDocShell> mDocShell;
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIPrincipal> mPrincipal;
int32_t mDelay;
@@ -743,7 +743,7 @@ public:
explicit RestorePresentationEvent(nsDocShell* aDs) : mDocShell(aDs) {}
void Revoke() { mDocShell = nullptr; }
private:
nsRefPtr<nsDocShell> mDocShell;
RefPtr<nsDocShell> mDocShell;
};
protected:
@@ -792,7 +792,7 @@ protected:
nsCOMPtr<nsISupportsArray> mRefreshURIList;
nsCOMPtr<nsISupportsArray> mSavedRefreshURIList;
nsRefPtr<nsDSURIContentListener> mContentListener;
RefPtr<nsDSURIContentListener> mContentListener;
nsCOMPtr<nsIContentViewer> mContentViewer;
nsCOMPtr<nsIWidget> mParentWidget;
@@ -800,7 +800,7 @@ protected:
nsCOMPtr<nsIURI> mCurrentURI;
nsCOMPtr<nsIURI> mReferrerURI;
uint32_t mReferrerPolicy;
nsRefPtr<nsGlobalWindow> mScriptGlobal;
RefPtr<nsGlobalWindow> mScriptGlobal;
nsCOMPtr<nsISHistory> mSessionHistory;
nsCOMPtr<nsIGlobalHistory2> mGlobalHistory;
nsCOMPtr<nsIWebBrowserFind> mFind;
@@ -977,7 +977,7 @@ protected:
static nsIURIFixup* sURIFixup;
nsRefPtr<nsDOMNavigationTiming> mTiming;
RefPtr<nsDOMNavigationTiming> mTiming;
// This flag means that mTiming has been initialized but nulled out.
// We will check the innerWin's timing before creating a new one
@@ -8,7 +8,7 @@
#define mozilla_AutoGlobalTimelineMarker_h_
#include "mozilla/GuardObjects.h"
#include "nsRefPtr.h"
#include "RefPtr.h"
class nsDocShell;
+2 -2
View File
@@ -8,7 +8,7 @@
#define mozilla_AutoTimelineMarker_h_
#include "mozilla/GuardObjects.h"
#include "nsRefPtr.h"
#include "RefPtr.h"
class nsIDocShell;
class nsDocShell;
@@ -36,7 +36,7 @@ class MOZ_RAII AutoTimelineMarker
const char* mName;
// The docshell that is associated with this marker.
nsRefPtr<nsDocShell> mDocShell;
RefPtr<nsDocShell> mDocShell;
public:
explicit AutoTimelineMarker(nsIDocShell* aDocShell, const char* aName
+2 -2
View File
@@ -8,7 +8,7 @@
#define mozilla_ObservedDocShell_h_
#include "nsTArray.h"
#include "mozilla/nsRefPtr.h"
#include "mozilla/RefPtr.h"
class nsDocShell;
@@ -26,7 +26,7 @@ struct ProfileTimelineMarker;
class ObservedDocShell : public LinkedListElement<ObservedDocShell>
{
private:
nsRefPtr<nsDocShell> mDocShell;
RefPtr<nsDocShell> mDocShell;
nsTArray<UniquePtr<TimelineMarker>> mTimelineMarkers;
public:
+4 -4
View File
@@ -50,7 +50,7 @@ TimelineConsumers::IsEmpty()
}
bool
TimelineConsumers::GetKnownDocShells(Vector<nsRefPtr<nsDocShell>>& aStore)
TimelineConsumers::GetKnownDocShells(Vector<RefPtr<nsDocShell>>& aStore)
{
const LinkedList<ObservedDocShell>& docShells = GetOrCreateObservedDocShellsList();
@@ -123,11 +123,11 @@ TimelineConsumers::AddMarkerForDocShell(nsIDocShell* aDocShell,
}
void
TimelineConsumers::AddMarkerForDocShellsList(Vector<nsRefPtr<nsDocShell>>& aDocShells,
TimelineConsumers::AddMarkerForDocShellsList(Vector<RefPtr<nsDocShell>>& aDocShells,
const char* aName,
MarkerTracingType aTracingType)
{
for (Vector<nsRefPtr<nsDocShell>>::Range range = aDocShells.all();
for (Vector<RefPtr<nsDocShell>>::Range range = aDocShells.all();
!range.empty();
range.popFront()) {
AddMarkerForDocShell(range.front(), aName, aTracingType);
@@ -138,7 +138,7 @@ void
TimelineConsumers::AddMarkerForAllObservedDocShells(const char* aName,
MarkerTracingType aTracingType)
{
Vector<nsRefPtr<nsDocShell>> docShells;
Vector<RefPtr<nsDocShell>> docShells;
if (!GetKnownDocShells(docShells)) {
// If we don't successfully populate our vector with *all* docshells being
// observed, don't add the marker to *any* of them.
+2 -2
View File
@@ -33,7 +33,7 @@ public:
static void AddConsumer(nsDocShell* aDocShell);
static void RemoveConsumer(nsDocShell* aDocShell);
static bool IsEmpty();
static bool GetKnownDocShells(Vector<nsRefPtr<nsDocShell>>& aStore);
static bool GetKnownDocShells(Vector<RefPtr<nsDocShell>>& aStore);
// Methods for adding markers relevant for particular docshells, or generic
// (meaning that they either can't be tied to a particular docshell, or one
@@ -70,7 +70,7 @@ public:
UniquePtr<TimelineMarker>&& aMarker);
// This method creates custom markers, relevant for a list of docshells.
static void AddMarkerForDocShellsList(Vector<nsRefPtr<nsDocShell>>& aDocShells,
static void AddMarkerForDocShellsList(Vector<RefPtr<nsDocShell>>& aDocShells,
const char* aName,
MarkerTracingType aTracingType);
+1 -1
View File
@@ -46,7 +46,7 @@ private:
// We share the state in here with other SHEntries which correspond to the
// same document.
nsRefPtr<nsSHEntryShared> mShared;
RefPtr<nsSHEntryShared> mShared;
// See nsSHEntry.idl for comments on these members.
nsCOMPtr<nsIURI> mURI;
+2 -2
View File
@@ -111,7 +111,7 @@ NS_IMPL_ISUPPORTS(nsSHEntryShared, nsIBFCacheEntry, nsIMutationObserver)
already_AddRefed<nsSHEntryShared>
nsSHEntryShared::Duplicate(nsSHEntryShared* aEntry)
{
nsRefPtr<nsSHEntryShared> newEntry = new nsSHEntryShared();
RefPtr<nsSHEntryShared> newEntry = new nsSHEntryShared();
newEntry->mDocShellID = aEntry->mDocShellID;
newEntry->mChildShells.AppendObjects(aEntry->mChildShells);
@@ -151,7 +151,7 @@ nsSHEntryShared::SyncPresentationState()
void
nsSHEntryShared::DropPresentationState()
{
nsRefPtr<nsSHEntryShared> kungFuDeathGrip = this;
RefPtr<nsSHEntryShared> kungFuDeathGrip = this;
if (mDocument) {
mDocument->SetBFCacheEntry(nullptr);
+1 -1
View File
@@ -1803,7 +1803,7 @@ NS_IMETHODIMP
nsSHistory::GetSHistoryEnumerator(nsISimpleEnumerator** aEnumerator)
{
NS_ENSURE_ARG_POINTER(aEnumerator);
nsRefPtr<nsSHEnumerator> iterator = new nsSHEnumerator(this);
RefPtr<nsSHEnumerator> iterator = new nsSHEnumerator(this);
iterator.forget(aEnumerator);
return NS_OK;
}
+1 -1
View File
@@ -36,7 +36,7 @@ public:
return nullptr;
}
nsRefPtr<Activity> activity = new Activity(window);
RefPtr<Activity> activity = new Activity(window);
aRv = activity->Initialize(window, aOwner.Context(), aOptions);
return activity.forget();
}
+1 -1
View File
@@ -43,7 +43,7 @@ AlarmHalService::GetInstance()
ClearOnShutdown(&sSingleton);
}
nsRefPtr<AlarmHalService> service = sSingleton.get();
RefPtr<AlarmHalService> service = sSingleton.get();
return service.forget();
}
+4 -4
View File
@@ -573,7 +573,7 @@ Animation::CanThrottle() const
}
void
Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
Animation::ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties,
bool& aNeedsRefreshes)
{
@@ -1101,7 +1101,7 @@ Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
if (aSyncNotifyFlag == SyncNotifyFlag::Sync) {
DoFinishNotificationImmediately();
} else if (!mFinishNotificationTask.IsPending()) {
nsRefPtr<nsRunnableMethod<Animation>> runnable =
RefPtr<nsRunnableMethod<Animation>> runnable =
NS_NewRunnableMethod(this, &Animation::DoFinishNotificationImmediately);
Promise::DispatchToMicroTask(runnable);
mFinishNotificationTask = runnable;
@@ -1150,11 +1150,11 @@ Animation::DispatchPlaybackEvent(const nsAString& aName)
init.mTimelineTime = mTimeline->GetCurrentTimeAsDouble();
}
nsRefPtr<AnimationPlaybackEvent> event =
RefPtr<AnimationPlaybackEvent> event =
AnimationPlaybackEvent::Constructor(this, aName, init);
event->SetTrusted(true);
nsRefPtr<AsyncEventDispatcher> asyncDispatcher =
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(this, event);
asyncDispatcher->PostDOMEvent();
}
+5 -5
View File
@@ -283,7 +283,7 @@ public:
* the style rule on the next refresh driver tick as well (because it
* is running and has an effect to sample).
*/
void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
void ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties,
bool& aNeedsRefreshes);
@@ -363,8 +363,8 @@ protected:
virtual CommonAnimationManager* GetAnimationManager() const = 0;
AnimationCollection* GetCollection() const;
nsRefPtr<AnimationTimeline> mTimeline;
nsRefPtr<KeyframeEffectReadOnly> mEffect;
RefPtr<AnimationTimeline> mTimeline;
RefPtr<KeyframeEffectReadOnly> mEffect;
// The beginning of the delay period.
Nullable<TimeDuration> mStartTime; // Timeline timescale
Nullable<TimeDuration> mHoldTime; // Animation timescale
@@ -376,14 +376,14 @@ protected:
// and fulfilled when Play() is successfully completed.
// This object is lazily created by GetReady.
// See http://w3c.github.io/web-animations/#current-ready-promise
nsRefPtr<Promise> mReady;
RefPtr<Promise> mReady;
// A Promise that is resolved when we reach the end of the effect, or
// 0 when playing backwards. The Promise is replaced if the animation is
// finished but then a state change makes it not finished.
// This object is lazily created by GetFinished.
// See http://w3c.github.io/web-animations/#current-finished-promise
nsRefPtr<Promise> mFinished;
RefPtr<Promise> mFinished;
// Indicates if the animation is in the pending state (and what state it is
// waiting to enter when it finished pending). We use this rather than
+1 -1
View File
@@ -55,7 +55,7 @@ AnimationTimeline::GetAnimations(AnimationSequence& aAnimations)
}
// Sort animations by priority
aAnimations.Sort(AnimationPtrComparator<nsRefPtr<Animation>>());
aAnimations.Sort(AnimationPtrComparator<RefPtr<Animation>>());
}
void
+1 -1
View File
@@ -42,7 +42,7 @@ public:
nsIGlobalObject* GetParentObject() const { return mWindow; }
typedef nsTArray<nsRefPtr<Animation>> AnimationSequence;
typedef nsTArray<RefPtr<Animation>> AnimationSequence;
// AnimationTimeline methods
virtual Nullable<TimeDuration> GetCurrentTime() const = 0;
+3 -3
View File
@@ -57,7 +57,7 @@ DocumentTimeline::GetCurrentTimeStamp() const
// If we don't have a refresh driver and we've never had one use the
// timeline's zero time.
if (result.IsNull()) {
nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
RefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
if (timing) {
result = timing->GetNavigationStartTimeStamp();
// Also, let this time represent the current refresh time. This way
@@ -82,7 +82,7 @@ DocumentTimeline::ToTimelineTime(const TimeStamp& aTimeStamp) const
return result;
}
nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
RefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
if (MOZ_UNLIKELY(!timing)) {
return result;
}
@@ -95,7 +95,7 @@ TimeStamp
DocumentTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
{
TimeStamp result;
nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
RefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
if (MOZ_UNLIKELY(!timing)) {
return result;
}
+1 -1
View File
@@ -366,7 +366,7 @@ KeyframeEffectReadOnly::HasAnimationOfProperties(
}
void
KeyframeEffectReadOnly::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
KeyframeEffectReadOnly::ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties)
{
ComputedTiming computedTiming = GetComputedTiming();
+1 -1
View File
@@ -312,7 +312,7 @@ public:
// Animation for the current time except any properties already contained
// in |aSetProperties|.
// Any updated properties are added to |aSetProperties|.
void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
void ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties);
bool IsRunningOnCompositor() const;
void SetIsRunningOnCompositor(nsCSSProperty aProperty, bool aIsRunning);
+3 -3
View File
@@ -105,12 +105,12 @@ ArchiveReaderEvent::RunShare(nsresult aStatus)
void
ArchiveReaderEvent::ShareMainThread()
{
nsTArray<nsRefPtr<File>> fileList;
nsTArray<RefPtr<File>> fileList;
if (!NS_FAILED(mStatus)) {
// This extra step must run in the main thread:
for (uint32_t index = 0; index < mFileList.Length(); ++index) {
nsRefPtr<ArchiveItem> item = mFileList[index];
RefPtr<ArchiveItem> item = mFileList[index];
nsString tmp;
nsresult rv = item->GetFilename(tmp);
@@ -131,7 +131,7 @@ ArchiveReaderEvent::ShareMainThread()
}
// This is a File:
nsRefPtr<File> file = item->GetFile(mArchiveReader);
RefPtr<File> file = item->GetFile(mArchiveReader);
if (file) {
fileList.AppendElement(file);
}

Some files were not shown because too many files have changed in this diff Show More