CLOSED TREE
This commit is contained in:
Phil Ringnalda 2015-10-17 20:00:32 -07:00
Родитель 10366350c5 01583602a9
Коммит 98800b5233
3685 изменённых файлов: 56450 добавлений и 26568 удалений

Просмотреть файл

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
No bug - unknown something produced intermittent OS X build failures in libstagefright and jemalloc and malloc
Bug 1210154 - Update the clang toolchain

Просмотреть файл

@ -1471,6 +1471,10 @@ a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, false);
atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, false);
break;
case nsIAccessibleEvent::EVENT_ALERT:
// A hack using state change showing events as alert events.
atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
break;
}
}

Просмотреть файл

@ -102,8 +102,9 @@ EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible)
if (aAccessible->mParent != mRoot)
return -1;
if (aAccessible->mIndexOfEmbeddedChild != -1)
return aAccessible->mIndexOfEmbeddedChild;
MOZ_ASSERT(!aAccessible->IsProxy());
if (aAccessible->mInt.mIndexOfEmbeddedChild != -1)
return aAccessible->mInt.mIndexOfEmbeddedChild;
return mFilterFunc(aAccessible) & filters::eMatch ?
EnsureNGetIndex(aAccessible) : -1;
@ -112,6 +113,7 @@ EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible)
void
EmbeddedObjCollector::AppendObject(Accessible* aAccessible)
{
aAccessible->mIndexOfEmbeddedChild = mObjects.Length();
MOZ_ASSERT(!aAccessible->IsProxy());
aAccessible->mInt.mIndexOfEmbeddedChild = mObjects.Length();
mObjects.AppendElement(aAccessible);
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -394,7 +394,7 @@ ARIAOwnsIterator::Next()
Accessible*
SingleAccIterator::Next()
{
nsRefPtr<Accessible> nextAcc;
RefPtr<Accessible> nextAcc;
mAcc.swap(nextAcc);
if (!nextAcc || nextAcc->IsDefunct()) {
return nullptr;

Просмотреть файл

@ -306,7 +306,7 @@ private:
SingleAccIterator(const SingleAccIterator&);
SingleAccIterator& operator = (const SingleAccIterator&);
nsRefPtr<Accessible> mAcc;
RefPtr<Accessible> mAcc;
};

Просмотреть файл

@ -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);

Просмотреть файл

@ -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();

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -124,8 +124,8 @@ private:
nsIDocument* FocusedDOMDocument() const;
private:
nsRefPtr<Accessible> mActiveItem;
nsRefPtr<Accessible> mActiveARIAMenubar;
RefPtr<Accessible> mActiveItem;
RefPtr<Accessible> mActiveARIAMenubar;
};
} // namespace a11y

Просмотреть файл

@ -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();
@ -291,7 +291,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())
@ -337,7 +337,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();

Просмотреть файл

@ -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

Просмотреть файл

@ -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)
@ -164,7 +164,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);
}
@ -189,7 +189,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);
@ -226,7 +226,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);

Просмотреть файл

@ -39,7 +39,7 @@ private:
void Margin(Side aSide, nsAString& aValue);
dom::Element* mElement;
nsRefPtr<nsStyleContext> mStyleContext;
RefPtr<nsStyleContext> mStyleContext;
};
} // namespace a11y

Просмотреть файл

@ -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();

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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();

Просмотреть файл

@ -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);

Просмотреть файл

@ -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());

Просмотреть файл

@ -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)) {
@ -1424,11 +1424,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")) {
@ -1600,7 +1600,7 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
{
DocAccessible* document = aContext->Document();
nsRefPtr<Accessible> newAcc;
RefPtr<Accessible> newAcc;
switch (aFrame->AccessibleType()) {
case eNoType:
return nullptr;
@ -1827,7 +1827,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()) {
@ -1860,19 +1860,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();
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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 :

Просмотреть файл

@ -107,9 +107,10 @@ Accessible::Accessible(nsIContent* aContent, DocAccessible* aDoc) :
mContent(aContent), mDoc(aDoc),
mParent(nullptr), mIndexInParent(-1), mChildrenFlags(eChildrenUninitialized),
mStateFlags(0), mContextFlags(0), mType(0), mGenericTypes(0),
mIndexOfEmbeddedChild(-1), mRoleMapEntry(nullptr)
mRoleMapEntry(nullptr)
{
mBits.groupInfo = nullptr;
mInt.mIndexOfEmbeddedChild = -1;
}
Accessible::~Accessible()
@ -1786,7 +1787,7 @@ Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
}
private:
nsRefPtr<Accessible> mAcc;
RefPtr<Accessible> mAcc;
nsCOMPtr<nsIContent> mContent;
uint32_t mIdx;
};
@ -1822,7 +1823,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);
@ -2001,7 +2002,7 @@ Accessible::UnbindFromParent()
#endif
mParent = nullptr;
mIndexInParent = -1;
mIndexOfEmbeddedChild = -1;
mInt.mIndexOfEmbeddedChild = -1;
if (IsProxy())
MOZ_CRASH("this should never be called on proxy wrappers");

Просмотреть файл

@ -618,6 +618,16 @@ public:
MOZ_ASSERT(IsProxy());
return mBits.proxy;
}
uint32_t ProxyInterfaces() const
{
MOZ_ASSERT(IsProxy());
return mInt.mProxyInterfaces;
}
void SetProxyInterfaces(uint32_t aInterfaces)
{
MOZ_ASSERT(IsProxy());
mInt.mProxyInterfaces = aInterfaces;
}
bool IsOuterDoc() const { return mType == eOuterDocType; }
OuterDocAccessible* AsOuterDoc();
@ -1111,8 +1121,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;
@ -1138,7 +1148,11 @@ protected:
friend class AutoTreeMutation;
nsAutoPtr<mozilla::a11y::EmbeddedObjCollector> mEmbeddedObjCollector;
int32_t mIndexOfEmbeddedChild;
union {
int32_t mIndexOfEmbeddedChild;
uint32_t mProxyInterfaces;
} mInt;
friend class EmbeddedObjCollector;
union

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -661,7 +661,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);
}
@ -679,7 +679,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,
@ -823,11 +823,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;
@ -886,7 +886,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;
@ -903,7 +903,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);
}
@ -912,7 +912,7 @@ DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
}
if (aAttribute == nsGkAtoms::contenteditable) {
nsRefPtr<AccEvent> editableChangeEvent =
RefPtr<AccEvent> editableChangeEvent =
new AccStateChangeEvent(aAccessible, states::EDITABLE);
FireDelayedEvent(editableChangeEvent);
return;
@ -932,14 +932,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;
@ -957,7 +957,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;
@ -967,7 +967,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);
}
@ -983,7 +983,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);
}
@ -995,14 +995,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);
}
@ -1010,7 +1010,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;
@ -1074,26 +1074,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);
}
@ -1373,8 +1373,8 @@ DocAccessible::ProcessInvalidationList()
// XXX: update context flags
{
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);
@ -1399,8 +1399,8 @@ DocAccessible::ProcessInvalidationList()
newParent = oldParent;
}
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(newParent);
nsRefPtr<AccMutationEvent> showEvent =
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(newParent);
RefPtr<AccMutationEvent> showEvent =
new AccShowEvent(child, child->GetContent());
FireDelayedEvent(showEvent);
reorderEvent->AddSubMutationEvent(showEvent);
@ -1485,14 +1485,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);
}
@ -1524,14 +1524,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);
}
}
@ -1557,14 +1557,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);
}
@ -1702,7 +1702,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++) {
@ -1710,7 +1710,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);
@ -1900,7 +1900,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++) {
@ -1972,7 +1972,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) {
@ -2054,7 +2054,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

Просмотреть файл

@ -624,12 +624,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.
@ -687,7 +687,7 @@ protected:
ARIAOwnsPair& operator =(const ARIAOwnsPair& aPair)
{ mOwner = aPair.mOwner; mChild = aPair.mChild; return *this; }
nsRefPtr<Accessible> mOwner;
RefPtr<Accessible> mOwner;
nsCOMPtr<nsIContent> mChild;
};
nsTArray<ARIAOwnsPair> mARIAOwnsInvalidationList;
@ -695,7 +695,7 @@ protected:
/**
* Used to process notification from core and accessible events.
*/
nsRefPtr<NotificationController> mNotificationController;
RefPtr<NotificationController> mNotificationController;
friend class EventQueue;
friend class NotificationController;

Просмотреть файл

@ -153,7 +153,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;
}
@ -168,7 +168,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;

Просмотреть файл

@ -1430,7 +1430,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;
@ -1499,7 +1499,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();
@ -1541,7 +1541,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;
@ -1649,7 +1649,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);
@ -1689,7 +1689,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);
}
@ -1707,7 +1707,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;
@ -2153,7 +2153,7 @@ HyperTextAccessible::GetSpellTextAttr(nsINode* aNode,
uint32_t* aEndOffset,
nsIPersistentProperties* aAttributes)
{
nsRefPtr<nsFrameSelection> fs = FrameSelection();
RefPtr<nsFrameSelection> fs = FrameSelection();
if (!fs)
return;

Просмотреть файл

@ -311,7 +311,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);
}
@ -332,7 +332,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);
}
@ -352,7 +352,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;
@ -378,7 +378,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);
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -64,7 +64,7 @@ protected:
virtual void CacheChildren() override;
private:
nsRefPtr<HTMLListBulletAccessible> mBullet;
RefPtr<HTMLListBulletAccessible> mBullet;
};

Просмотреть файл

@ -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);

Просмотреть файл

@ -196,7 +196,7 @@ protected:
Accessible* SelectedOption() const;
private:
nsRefPtr<HTMLComboboxListAccessible> mListAccessible;
RefPtr<HTMLComboboxListAccessible> mListAccessible;
};
/*

Просмотреть файл

@ -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);

Просмотреть файл

@ -118,12 +118,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;
@ -140,7 +140,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) {
@ -186,11 +186,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++;
@ -207,7 +207,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));

Просмотреть файл

@ -26,7 +26,10 @@ ia2AccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
*ppv = nullptr;
if (IID_IAccessibleHyperlink == iid) {
if (!static_cast<AccessibleWrap*>(this)->IsLink())
auto accWrap = static_cast<AccessibleWrap*>(this);
if (accWrap->IsProxy() ?
!(accWrap->ProxyInterfaces() & Interfaces::HYPERLINK) :
!accWrap->IsLink())
return E_NOINTERFACE;
*ppv = static_cast<IAccessibleHyperlink*>(this);

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -833,7 +833,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);
}

Просмотреть файл

@ -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;
};
/**

Просмотреть файл

@ -46,6 +46,7 @@ a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
wrapper = new ProxyAccessibleWrap(aProxy);
}
wrapper->SetProxyInterfaces(aInterfaces);
wrapper->AddRef();
aProxy->SetWrapper(reinterpret_cast<uintptr_t>(wrapper));
}

Просмотреть файл

@ -29,7 +29,7 @@ public:
void** aInstancePtr);
private:
nsRefPtr<AccessibleWrap> mAccessible;
RefPtr<AccessibleWrap> mAccessible;
};
}

Просмотреть файл

@ -44,7 +44,7 @@ public:
/* [in] */ BSTR __RPC_FAR *commaSeparatedMediaTypes);
protected:
nsRefPtr<DocAccessibleWrap> mAccessible;
RefPtr<DocAccessibleWrap> mAccessible;
};
} // namespace a11y

Просмотреть файл

@ -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 =

Просмотреть файл

@ -62,7 +62,7 @@ private:
int32_t aOffset, bool aPreferNext,
nsPoint& aOutPoint);
nsRefPtr<AccessibleWrap> mAccessible;
RefPtr<AccessibleWrap> mAccessible;
};
} // namespace a11y

Просмотреть файл

@ -66,7 +66,7 @@ private:
uiaRawElmProvider(const uiaRawElmProvider&) = delete;
protected:
nsRefPtr<AccessibleWrap> mAcc;
RefPtr<AccessibleWrap> mAcc;
};
} // a11y namespace

Просмотреть файл

@ -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();

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

@ -36,7 +36,7 @@ protected:
virtual void CacheChildren() override;
private:
nsRefPtr<XULLabelTextLeafAccessible> mValueTextLeaf;
RefPtr<XULLabelTextLeafAccessible> mValueTextLeaf;
};
inline XULLabelAccessible*

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -51,4 +51,6 @@ exports.send = send;
* Implement internal structured cloning algorithm in the future?
* http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#internal-structured-cloning-algorithm
*/
function clone (obj) JSON.parse(JSON.stringify(obj || {}))
function clone (obj) {
return JSON.parse(JSON.stringify(obj || {}));
}

Просмотреть файл

@ -62,31 +62,33 @@ function definePseudo(loader, id, exports) {
loader.modules[uri] = { exports: exports };
}
function startup(reason, options) Startup.onceInitialized.then(() => {
// Inject globals ASAP in order to have console API working ASAP
Object.defineProperties(options.loader.globals, descriptor(globals));
function startup(reason, options) {
return Startup.onceInitialized.then(() => {
// Inject globals ASAP in order to have console API working ASAP
Object.defineProperties(options.loader.globals, descriptor(globals));
// NOTE: Module is intentionally required only now because it relies
// on existence of hidden window, which does not exists until startup.
let { ready } = require('../addon/window');
// Load localization manifest and .properties files.
// Run the addon even in case of error (best effort approach)
require('../l10n/loader').
load(rootURI).
then(null, function failure(error) {
if (!isNative)
console.info("Error while loading localization: " + error.message);
}).
then(function onLocalizationReady(data) {
// Exports data to a pseudo module so that api-utils/l10n/core
// can get access to it
definePseudo(options.loader, '@l10n/data', data ? data : null);
return ready;
}).then(function() {
run(options);
}).then(null, console.exception);
// NOTE: Module is intentionally required only now because it relies
// on existence of hidden window, which does not exists until startup.
let { ready } = require('../addon/window');
// Load localization manifest and .properties files.
// Run the addon even in case of error (best effort approach)
require('../l10n/loader').
load(rootURI).
then(null, function failure(error) {
if (!isNative)
console.info("Error while loading localization: " + error.message);
}).
then(function onLocalizationReady(data) {
// Exports data to a pseudo module so that api-utils/l10n/core
// can get access to it
definePseudo(options.loader, '@l10n/data', data ? data : null);
return ready;
}).then(function() {
run(options);
}).then(null, console.exception);
return void 0; // otherwise we raise a warning, see bug 910304
});
});
}
function run(options) {
try {

Просмотреть файл

@ -17,4 +17,4 @@ const { isBrowser } = require("../window/utils");
// implementation for `isBrowser`. Either way it's not really needed yet
// neither window tracker provides this event.
exports.events = filter(events, function({target}) isBrowser(target));
exports.events = filter(events, ({target}) => isBrowser(target));

Просмотреть файл

@ -138,7 +138,7 @@ CONTEXTS.PageContext = Class({
// If the clicked node or any of its ancestors is one of the blocked
// NON_PAGE_CONTEXT_ELTS then this context does not match
while (!(popupNode instanceof Ci.nsIDOMDocument)) {
if (NON_PAGE_CONTEXT_ELTS.some(function(type) popupNode instanceof type))
if (NON_PAGE_CONTEXT_ELTS.some(type => popupNode instanceof type))
return false;
popupNode = popupNode.parentNode;

Просмотреть файл

@ -49,9 +49,9 @@ var opened = windows(null, { includePrivate: true });
var state = merge(opened.map(streamEventsFrom));
var futureReady = filter(windowEvents, function({type})
var futureReady = filter(windowEvents, ({type}) =>
type === "DOMContentLoaded");
var futureWindows = map(futureReady, function({target}) target);
var futureWindows = map(futureReady, ({target}) => target);
var futureState = expand(futureWindows, streamEventsFrom);
exports.events = merge([insert, create, state, futureState]);

Просмотреть файл

@ -63,14 +63,22 @@ exports.validationAttributes = valid;
* @param {Object} validation
* validation rule passed to `api-utils`
*/
function validate(suspect, validation) validateOptions(
{ $: suspect },
{ $: validation }
).$
function validate(suspect, validation) {
return validateOptions(
{ $: suspect },
{ $: validation }
).$;
}
function Allow(script) ({
get script() script,
set script(value) script = !!value
})
function Allow(script) {
return {
get script() {
return script;
},
set script(value) {
script = !!value;
}
};
}
exports.contract = contract(valid);

Просмотреть файл

@ -162,9 +162,15 @@ const WorkerSandbox = Class({
let parent = window.parent === window ? content : content.parent;
merge(content, {
// We need 'this === window === top' to be true in toplevel scope:
get window() content,
get top() top,
get parent() parent
get window() {
return content;
},
get top() {
return top;
},
get parent() {
return parent;
}
});
// Use the Greasemonkey naming convention to provide access to the

Просмотреть файл

@ -160,7 +160,7 @@ var URLContext = Class({
patterns = Array.isArray(patterns) ? patterns : [patterns];
try {
internal(this).patterns = patterns.map(function (p) new MatchPattern(p));
internal(this).patterns = patterns.map(p => new MatchPattern(p));
}
catch (err) {
throw new Error("Patterns must be a string, regexp or an array of " +
@ -169,7 +169,7 @@ var URLContext = Class({
},
isCurrent: function isCurrent(url) {
return internal(this).patterns.some(function (p) p.test(url));
return internal(this).patterns.some(p => p.test(url));
},
serialize: function() {
@ -212,11 +212,13 @@ var PredicateContext = Class({
exports.PredicateContext = PredicateContext;
function removeItemFromArray(array, item) {
return array.filter(function(i) i !== item);
return array.filter(i => i !== item);
}
// Converts anything that isn't false, null or undefined into a string
function stringOrNull(val) val ? String(val) : val;
function stringOrNull(val) {
return val ? String(val) : val;
}
// Shared option validation rules for Item, Menu, and Separator
var baseItemRules = {
@ -235,7 +237,7 @@ var baseItemRules = {
if (!v)
return true;
let arr = Array.isArray(v) ? v : [v];
return arr.every(function (o) o instanceof Context);
return arr.every(o => o instanceof Context);
},
msg: "The 'context' option must be a Context object or an array of " +
"Context objects."
@ -251,7 +253,7 @@ var labelledItemRules = mix(baseItemRules, {
label: {
map: stringOrNull,
is: ["string"],
ok: function (v) !!v,
ok: v => !!v,
msg: "The item must have a non-empty string label."
},
accesskey: {

Просмотреть файл

@ -32,14 +32,16 @@ var promised = (function() {
// Utility function that does following:
// execute([ f, self, args...]) => f.apply(self, args)
function execute (args) call.apply(call, args)
function execute (args) {
return call.apply(call, args);
}
// Utility function that takes promise of `a` array and maybe promise `b`
// as arguments and returns promise for `a.concat(b)`.
function promisedConcat(promises, unknown) {
return promises.then(function (values) {
return resolve(unknown)
.then(function (value) values.concat([value]));
.then(value => values.concat([value]));
});
}

Просмотреть файл

@ -54,7 +54,9 @@ const TestRunner = function TestRunner(options) {
};
TestRunner.prototype = {
toString: function toString() "[object TestRunner]",
toString: function toString() {
return "[object TestRunner]";
},
DEFAULT_PAUSE_TIMEOUT: (cfxArgs.parseable ? 300000 : 15000), //Five minutes (5*60*1000ms)
PAUSE_DELAY: 500,

Просмотреть файл

@ -21,7 +21,9 @@ const appShellService = Cc['@mozilla.org/appshell/appShellService;1'].
getService(Ci.nsIAppShellService);
// Bug 834961: ignore private windows when they are not supported
function getWindows() windows(null, { includePrivate: isPrivateBrowsingSupported });
function getWindows() {
return windows(null, { includePrivate: isPrivateBrowsingSupported });
}
/**
* An iterator for XUL windows currently in the application.

Просмотреть файл

@ -48,7 +48,7 @@ FrameOptions.validator = {
ok: function(v) {
if (getTypeOf(v) === "array") {
// make sure every item is a function
return v.every(function (item) typeof(item) === "function")
return v.every(item => typeof(item) === "function")
}
return true;
}
@ -112,4 +112,4 @@ function removeHiddenFrame(frame) {
}
exports.remove = removeHiddenFrame;
unload(function() fromIterator(cache).forEach(removeHiddenFrame));
unload(() => fromIterator(cache).forEach(removeHiddenFrame));

Просмотреть файл

@ -95,6 +95,7 @@ function create(target, options) {
}
exports.create = create;
function swapFrameLoaders(from, to)
from.QueryInterface(Ci.nsIFrameLoaderOwner).swapFrameLoaders(to)
function swapFrameLoaders(from, to) {
return from.QueryInterface(Ci.nsIFrameLoaderOwner).swapFrameLoaders(to);
}
exports.swapFrameLoaders = swapFrameLoaders;

Просмотреть файл

@ -323,7 +323,9 @@ Object.defineProperties(Buffer.prototype, {
['readUInt8', 'getUint8'],
['readInt8', 'getInt8']].forEach(([alias, name, littleEndian]) => {
Object.defineProperty(Buffer.prototype, alias, {
value: function(offset) this.view[name](offset, littleEndian)
value: function(offset) {
return this.view[name](offset, littleEndian);
}
});
});
@ -342,6 +344,8 @@ Object.defineProperties(Buffer.prototype, {
['writeUInt8', 'setUint8'],
['writeInt8', 'setInt8']].forEach(([alias, name, littleEndian]) => {
Object.defineProperty(Buffer.prototype, alias, {
value: function(value, offset) this.view[name](offset, value, littleEndian)
value: function(value, offset) {
return this.view[name](offset, value, littleEndian);
}
});
});

Просмотреть файл

@ -82,11 +82,19 @@ var nsIBinaryOutputStream = accessor();
// needs to be read.
const ALL = new String("Read all of the file");
function isWritable(mode) !!(mode & PR_WRONLY || mode & PR_RDWR)
function isReadable(mode) !!(mode & PR_RDONLY || mode & PR_RDWR)
function isWritable(mode) {
return !!(mode & PR_WRONLY || mode & PR_RDWR);
}
function isReadable(mode) {
return !!(mode & PR_RDONLY || mode & PR_RDWR);
}
function isString(value) typeof(value) === "string"
function isFunction(value) typeof(value) === "function"
function isString(value) {
return typeof(value) === "string";
}
function isFunction(value) {
return typeof(value) === "function";
}
function toArray(enumerator) {
let value = [];
@ -95,7 +103,9 @@ function toArray(enumerator) {
return value
}
function getFileName(file) file.QueryInterface(Ci.nsIFile).leafName
function getFileName(file) {
return file.QueryInterface(Ci.nsIFile).leafName;
}
function remove(path, recursive) {
@ -249,33 +259,67 @@ const Stats = Class({
if (!file.exists()) throw FSError("stat", "ENOENT", 34, path);
nsIFile(this, file);
},
isDirectory: function() nsIFile(this).isDirectory(),
isFile: function() nsIFile(this).isFile(),
isSymbolicLink: function() nsIFile(this).isSymlink(),
get mode() nsIFile(this).permissions,
get size() nsIFile(this).fileSize,
get mtime() nsIFile(this).lastModifiedTime,
isBlockDevice: function() nsIFile(this).isSpecial(),
isCharacterDevice: function() nsIFile(this).isSpecial(),
isFIFO: function() nsIFile(this).isSpecial(),
isSocket: function() nsIFile(this).isSpecial(),
isDirectory: function() {
return nsIFile(this).isDirectory();
},
isFile: function() {
return nsIFile(this).isFile();
},
isSymbolicLink: function() {
return nsIFile(this).isSymlink();
},
get mode() {
return nsIFile(this).permissions;
},
get size() {
return nsIFile(this).fileSize;
},
get mtime() {
return nsIFile(this).lastModifiedTime;
},
isBlockDevice: function() {
return nsIFile(this).isSpecial();
},
isCharacterDevice: function() {
return nsIFile(this).isSpecial();
},
isFIFO: function() {
return nsIFile(this).isSpecial();
},
isSocket: function() {
return nsIFile(this).isSpecial();
},
// non standard
get exists() nsIFile(this).exists(),
get hidden() nsIFile(this).isHidden(),
get writable() nsIFile(this).isWritable(),
get readable() nsIFile(this).isReadable()
get exists() {
return nsIFile(this).exists();
},
get hidden() {
return nsIFile(this).isHidden();
},
get writable() {
return nsIFile(this).isWritable();
},
get readable() {
return nsIFile(this).isReadable();
}
});
exports.Stats = Stats;
const LStats = Class({
extends: Stats,
get size() this.isSymbolicLink() ? nsIFile(this).fileSizeOfLink :
nsIFile(this).fileSize,
get mtime() this.isSymbolicLink() ? nsIFile(this).lastModifiedTimeOfLink :
nsIFile(this).lastModifiedTime,
get size() {
return this.isSymbolicLink() ? nsIFile(this).fileSizeOfLink :
nsIFile(this).fileSize;
},
get mtime() {
return this.isSymbolicLink() ? nsIFile(this).lastModifiedTimeOfLink :
nsIFile(this).lastModifiedTime;
},
// non standard
get permissions() this.isSymbolicLink() ? nsIFile(this).permissionsOfLink :
nsIFile(this).permissions
get permissions() {
return this.isSymbolicLink() ? nsIFile(this).permissionsOfLink :
nsIFile(this).permissions;
}
});
const FStat = Class({

Просмотреть файл

@ -181,7 +181,9 @@ const InputStream = Class({
this.inputStreamPump = inputStreamPump;
this.binaryInputStream = binaryInputStream;
},
get status() nsIInputStreamPump(this).status,
get status() {
return nsIInputStreamPump(this).status;
},
read: function() {
nsIInputStreamPump(this).asyncRead(nsIStreamListener(this), null);
},

Просмотреть файл

@ -185,8 +185,12 @@ const LOCALES_TO_RULES = {
};
// Utility functions for plural rules methods
function isIn(n, list) list.indexOf(n) !== -1;
function isBetween(n, start, end) start <= n && n <= end;
function isIn(n, list) {
return list.indexOf(n) !== -1;
}
function isBetween(n, start, end) {
return start <= n && n <= end;
}
// List of all plural rules methods, that maps an integer to the plural form name to use
const RULES = {

Просмотреть файл

@ -80,4 +80,4 @@ function get(key, n, locales) {
return undefined;
}
exports.get = function(k, n) get(k, n, Array.slice(preferedLocales));
exports.get = (k, n) => get(k, n, Array.slice(preferedLocales));

Просмотреть файл

@ -70,7 +70,7 @@ exports.notify = function notifications_notify(options) {
function notifyUsingConsole(iconURL, title, text) {
title = title ? "[" + title + "]" : "";
text = text || "";
let str = [title, text].filter(function (s) s).join(" ");
let str = [title, text].filter(s => s).join(" ");
console.log(str);
}

Просмотреть файл

@ -39,10 +39,18 @@ const readyEventNames = [
'load'
];
function workerFor(page) workers.get(page)
function pageFor(view) pages.get(view)
function viewFor(page) views.get(page)
function isDisposed (page) !views.get(page, false)
function workerFor(page) {
return workers.get(page);
}
function pageFor(view) {
return pages.get(view);
}
function viewFor(page) {
return views.get(page);
}
function isDisposed (page) {
return !views.get(page, false);
}
var pageContract = contract(merge({
allow: {
@ -82,7 +90,9 @@ function injectWorker ({page}) {
attach(worker, view.contentWindow);
}
function isValidURL(page, url) !page.rules || page.rules.matchesAny(url)
function isValidURL(page, url) {
return !page.rules || page.rules.matchesAny(url);
}
const Page = Class({
implements: [

Просмотреть файл

@ -95,7 +95,9 @@ function setScriptState(panel, value) {
view.setAttribute("sdkscriptenabled", "" + value);
}
function isDisposed(panel) !views.has(panel);
function isDisposed(panel) {
return !views.has(panel);
}
var panels = new WeakMap();
var models = new WeakMap();
@ -201,27 +203,43 @@ const Panel = Class({
views.delete(this);
},
/* Public API: Panel.width */
get width() modelFor(this).width,
set width(value) this.resize(value, this.height),
get width() {
return modelFor(this).width;
},
set width(value) {
this.resize(value, this.height);
},
/* Public API: Panel.height */
get height() modelFor(this).height,
set height(value) this.resize(this.width, value),
get height() {
return modelFor(this).height;
},
set height(value) {
this.resize(this.width, value);
},
/* Public API: Panel.focus */
get focus() modelFor(this).focus,
get focus() {
return modelFor(this).focus;
},
/* Public API: Panel.position */
get position() modelFor(this).position,
get position() {
return modelFor(this).position;
},
/* Public API: Panel.contextMenu */
get contextMenu() modelFor(this).contextMenu,
get contextMenu() {
return modelFor(this).contextMenu;
},
set contextMenu(allow) {
let model = modelFor(this);
model.contextMenu = panelContract({ contextMenu: allow }).contextMenu;
domPanel.allowContextMenu(viewFor(this), model.contextMenu);
},
get contentURL() modelFor(this).contentURL,
get contentURL() {
return modelFor(this).contentURL;
},
set contentURL(value) {
let model = modelFor(this);
model.contentURL = panelContract({ contentURL: value }).contentURL;
@ -238,7 +256,9 @@ const Panel = Class({
},
/* Public API: Panel.isShowing */
get isShowing() !isDisposed(this) && domPanel.isOpen(viewFor(this)),
get isShowing() {
return !isDisposed(this) && domPanel.isOpen(viewFor(this));
},
/* Public API: Panel.show */
show: function show(options={}, anchor) {

Просмотреть файл

@ -16,11 +16,12 @@ const { emit } = require("../event/core");
var channel = {};
function forward({ subject, type, data })
emit(channel, "data", { target: subject, type: type, data: data });
function forward({ subject, type, data }) {
return emit(channel, "data", { target: subject, type: type, data: data });
}
["popupshowing", "popuphiding", "popupshown", "popuphidden",
"document-element-inserted", "DOMContentLoaded", "load"
].forEach(function(type) events.on(type, forward));
].forEach(type => events.on(type, forward));
exports.events = channel;

Просмотреть файл

@ -429,7 +429,9 @@ var getContentFrame = panel =>
panel.backgroundFrame
exports.getContentFrame = getContentFrame;
function getContentDocument(panel) getContentFrame(panel).contentDocument
function getContentDocument(panel) {
return getContentFrame(panel).contentDocument;
}
exports.getContentDocument = getContentDocument;
function setURL(panel, url) {

Просмотреть файл

@ -16,8 +16,9 @@ const { URL: parseURL } = require("../url");
const LoginInfo = CC("@mozilla.org/login-manager/loginInfo;1",
"nsILoginInfo", "init");
function filterMatchingLogins(loginInfo)
Object.keys(this).every(function(key) loginInfo[key] === this[key], this);
function filterMatchingLogins(loginInfo) {
return Object.keys(this).every(key => loginInfo[key] === this[key], this);
}
/**
* Removes `user`, `password` and `path` fields from the given `url` if it's
@ -70,7 +71,9 @@ Login.prototype.toLoginInfo = function toLoginInfo() {
usernameField, passwordField);
};
function loginToJSON(value) Login(value).toJSON()
function loginToJSON(value) {
return Login(value).toJSON();
}
/**
* Returns array of `nsILoginInfo` objects that are stored in the login manager

Просмотреть файл

@ -62,7 +62,7 @@ const Bookmark = Class({
merge(this, bookmarkContract(extend(defaults, options)));
},
type: 'bookmark',
toString: function () '[object Bookmark]'
toString: () => '[object Bookmark]'
});
exports.Bookmark = Bookmark;
@ -78,7 +78,7 @@ const Group = Class({
merge(this, groupContract(extend(defaults, options)));
},
type: 'group',
toString: function () '[object Group]'
toString: () => '[object Group]'
});
exports.Group = Group;
@ -90,7 +90,7 @@ const Separator = Class({
merge(this, separatorContract(extend(defaults, options)));
},
type: 'separator',
toString: function () '[object Separator]'
toString: () => '[object Separator]'
});
exports.Separator = Separator;

Просмотреть файл

@ -29,7 +29,7 @@ const validItem = {
},
index: {
is: ['undefined', 'null', 'number'],
map: function (value) value == null ? -1 : value,
map: value => value == null ? -1 : value,
msg: 'The `index` property must be a number.'
},
updated: {
@ -55,7 +55,7 @@ const validURL = {
const validTags = {
tags: {
is: ['object'],
ok: function (tags) tags instanceof Set,
ok: tags => tags instanceof Set,
map: function (tags) {
if (Array.isArray(tags))
return new Set(tags);

Просмотреть файл

@ -63,8 +63,9 @@ function typeMap (type) {
}
}
function getBookmarkLastUpdated ({id})
resolve(bmsrv.getItemLastModified(id))
function getBookmarkLastUpdated ({id}) {
return resolve(bmsrv.getItemLastModified(id));
}
exports.getBookmarkLastUpdated;
function createBookmarkItem (data) {

Просмотреть файл

@ -155,7 +155,7 @@ function normalize (historyObj) {
* Hook into host
*/
var reqStream = filter(request, function (data) /sdk-places-query/.test(data.event));
var reqStream = filter(request, data => /sdk-places-query/.test(data.event));
on(reqStream, 'data', function (e) {
if (EVENT_MAP[e.event]) EVENT_MAP[e.event](e);
});

Просмотреть файл

@ -60,7 +60,7 @@ function getURLsByTag (message) {
};
resData.data = taggingService
.getURIsForTag(data.tag).map(function (uri) uri.spec);
.getURIsForTag(data.tag).map(uri => uri.spec);
respond(resData);
}

Просмотреть файл

@ -44,7 +44,7 @@ var TreeNode = Class({
},
get: method(get),
walk: method(walk),
toString: function () '[object TreeNode]'
toString: () => '[object TreeNode]'
});
exports.TreeNode = TreeNode;
@ -103,8 +103,9 @@ exports.constructTree = constructTree;
* Shortcut for converting an id, or an object with an id, into
* an object with corresponding bookmark data
*/
function fetchItem (item)
send('sdk-places-bookmarks-get', { id: item.id || item })
function fetchItem (item) {
return send('sdk-places-bookmarks-get', { id: item.id || item });
}
exports.fetchItem = fetchItem;
/*

Просмотреть файл

@ -21,8 +21,8 @@ const { uuid } = require('../util/uuid');
const Unknown = new function() {
function hasInterface(component, iid) {
return component && component.interfaces &&
( component.interfaces.some(function(id) iid.equals(Ci[id])) ||
component.implements.some(function($) hasInterface($, iid)) ||
( component.interfaces.some(id => iid.equals(Ci[id])) ||
component.implements.some($ => hasInterface($, iid)) ||
hasInterface(Object.getPrototypeOf(component), iid));
}
@ -85,7 +85,9 @@ const Factory = Class({
* This method is required by `nsIFactory` interfaces, but as in most
* implementations it does nothing interesting.
*/
lockFactory: function lockFactory(lock) undefined,
lockFactory: function lockFactory(lock) {
return undefined;
},
/**
* If property is `true` XPCOM service / factory will be registered
* automatically on creation.
@ -131,7 +133,9 @@ const Factory = Class({
throw error instanceof Ci.nsIException ? error : Cr.NS_ERROR_FAILURE;
}
},
create: function create() this.Component()
create: function create() {
return this.Component();
}
});
exports.Factory = Factory;
@ -148,11 +152,15 @@ const Service = Class({
/**
* Creates an instance of the class associated with this factory.
*/
create: function create() this.component
create: function create() {
return this.component;
}
});
exports.Service = Service;
function isRegistered({ id }) isCIDRegistered(id)
function isRegistered({ id }) {
return isCIDRegistered(id);
}
exports.isRegistered = isRegistered;
/**
@ -216,7 +224,9 @@ exports.autoRegister = autoRegister;
/**
* Returns registered factory that has a given `id` or `null` if not found.
*/
function factoryByID(id) classesByID[id] || null
function factoryByID(id) {
return classesByID[id] || null;
}
exports.factoryByID = factoryByID;
/**
@ -225,5 +235,7 @@ exports.factoryByID = factoryByID;
* with a given `contract` this will return a factory currently associated
* with a `contract`.
*/
function factoryByContract(contract) factoryByID(Cm.contractIDToCID(contract))
function factoryByContract(contract) {
return factoryByID(Cm.contractIDToCID(contract));
}
exports.factoryByContract = factoryByContract;

Просмотреть файл

@ -26,27 +26,27 @@ const request = ns();
const { validateOptions, validateSingleOption } = new OptionsValidator({
url: {
// Also converts a URL instance to string, bug 857902
map: function (url) url.toString(),
map: url => url.toString(),
ok: isValidURI
},
headers: {
map: function (v) v || {},
map: v => v || {},
is: ["object"],
},
content: {
map: function (v) v || null,
map: v => v || null,
is: ["string", "object", "null"],
},
contentType: {
map: function (v) v || "application/x-www-form-urlencoded",
map: v => v || "application/x-www-form-urlencoded",
is: ["string"],
},
overrideMimeType: {
map: function(v) v || null,
map: v => v || null,
is: ["string", "null"],
},
anonymous: {
map: function(v) v || false,
map: v => v || false,
is: ["boolean", "null"],
}
});
@ -165,14 +165,22 @@ const Response = Class({
response(this).request = request;
},
// more about responseURL: https://bugzilla.mozilla.org/show_bug.cgi?id=998076
get url() response(this).request.responseURL,
get text() response(this).request.responseText,
get url() {
return response(this).request.responseURL;
},
get text() {
return response(this).request.responseText;
},
get xml() {
throw new Error("Sorry, the 'xml' property is no longer available. " +
"see bug 611042 for more information.");
},
get status() response(this).request.status,
get statusText() response(this).request.statusText,
get status() {
return response(this).request.status;
},
get statusText() {
return response(this).request.statusText;
},
get json() {
try {
return JSON.parse(this.text);
@ -212,7 +220,9 @@ const Response = Class({
});
return headers;
},
get anonymous() response(this).request.mozAnon
get anonymous() {
return response(this).request.mozAnon;
}
});
// apiUtils.validateOptions doesn't give the ability to easily validate single

Просмотреть файл

@ -80,7 +80,7 @@ const Selection = Class({
const selectionListener = {
notifySelectionChanged: function (document, selection, reason) {
if (!["SELECTALL", "KEYPRESS", "MOUSEUP"].some(function(type) reason &
if (!["SELECTALL", "KEYPRESS", "MOUSEUP"].some(type => reason &
Ci.nsISelectionListener[type + "_REASON"]) || selection.toString() == "")
return;

Просмотреть файл

@ -15,16 +15,18 @@ const { get, set, exists } = Cc['@mozilla.org/process/environment;1'].
exports.env = Proxy.create({
// XPCOM does not provides a way to enumerate environment variables, so we
// just don't support enumeration.
getPropertyNames: function() [],
getOwnPropertyNames: function() [],
enumerate: function() [],
keys: function() [],
getPropertyNames: () => [],
getOwnPropertyNames: () => [],
enumerate: () => [],
keys: () => [],
// We do not support freezing, cause it would make it impossible to set new
// environment variables.
fix: function() undefined,
fix: () => undefined,
// We present all environment variables as own properties of this object,
// so we just delegate this call to `getOwnPropertyDescriptor`.
getPropertyDescriptor: function(name) this.getOwnPropertyDescriptor(name),
getPropertyDescriptor: function(name) {
return this.getOwnPropertyDescriptor(name);
},
// If environment variable with this name is defined, we generate proprety
// descriptor for it, otherwise fall back to `undefined` so that for consumer
// this property does not exists.
@ -39,22 +41,24 @@ exports.env = Proxy.create({
// New environment variables can be defined just by defining properties
// on this object.
defineProperty: function(name, { value }) set(name, value),
defineProperty: (name, { value }) => set(name, value),
delete: function(name) {
set(name, null);
return true;
},
// We present all properties as own, there for we just delegate to `hasOwn`.
has: function(name) this.hasOwn(name),
has: function(name) {
return this.hasOwn(name);
},
// We do support checks for existence of an environment variable, via `in`
// operator on this object.
hasOwn: function(name) exists(name),
hasOwn: name => exists(name),
// On property get / set we do read / write appropriate environment variables,
// please note though, that variables with names of standard object properties
// intentionally (so that this behaves as normal object) can not be
// read / set.
get: function(proxy, name) Object.prototype[name] || get(name) || undefined,
set: function(proxy, name, value) Object.prototype[name] || set(name, value)
get: (proxy, name) => Object.prototype[name] || get(name) || undefined,
set: (proxy, name, value) => Object.prototype[name] || set(name, value)
});

Просмотреть файл

@ -35,14 +35,14 @@ function tabEventsFor(window) {
// Map supported event types to a streams of those events on the given
// `window` and than merge these streams into single form stream off
// all events.
let channels = TYPES.map(function(type) open(window, type));
let channels = TYPES.map(type => open(window, type));
return merge(channels);
}
// Filter DOMContentLoaded events from all the browser events.
var readyEvents = filter(events, function(e) e.type === "DOMContentLoaded");
var readyEvents = filter(events, e => e.type === "DOMContentLoaded");
// Map DOMContentLoaded events to it's target browser windows.
var futureWindows = map(readyEvents, function(e) e.target);
var futureWindows = map(readyEvents, e => e.target);
// Expand all browsers that will become interactive to supported tab events
// on these windows. Result will be a tab events from all tabs of all windows
// that will become interactive.

Просмотреть файл

@ -58,8 +58,12 @@ const Tab = Class({
* Changing this property changes an actual title.
* @type {String}
*/
get title() getTabTitle(tabNS(this).tab),
set title(title) setTabTitle(tabNS(this).tab, title),
get title() {
return getTabTitle(tabNS(this).tab);
},
set title(title) {
setTabTitle(tabNS(this).tab, title);
},
/**
* Location of the page currently loaded in this tab.
@ -69,7 +73,9 @@ const Tab = Class({
get url() {
return tabNS(this).closed ? undefined : getTabURL(tabNS(this).tab);
},
set url(url) setTabURL(tabNS(this).tab, url),
set url(url) {
setTabURL(tabNS(this).tab, url);
},
getThumbnail: function() {
// TODO: implement!
@ -131,7 +137,9 @@ const Tab = Class({
* rendered as.
* @type {String}
*/
get contentType() getTabContentType(tabNS(this).tab),
get contentType() {
return getTabContentType(tabNS(this).tab);
},
/**
* Create a worker for this tab, first argument is options given to Worker.

Просмотреть файл

@ -17,7 +17,9 @@ const { windows, isBrowser } = require('../window/utils');
const { isPrivateBrowsingSupported } = require('../self');
// Bug 834961: ignore private windows when they are not supported
function getWindows() windows(null, { includePrivate: isPrivateBrowsingSupported });
function getWindows() {
return windows(null, { includePrivate: isPrivateBrowsingSupported });
}
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@ -91,7 +93,7 @@ function getTabs(window) {
return window.BrowserApp.tabs;
// firefox - default
return Array.filter(getTabContainer(window).children, function(t) !t.closing);
return Array.filter(getTabContainer(window).children, t => !t.closing);
}
exports.getTabs = getTabs;
@ -321,7 +323,9 @@ function unpin(tab) {
}
exports.unpin = unpin;
function isPinned(tab) !!tab.pinned
function isPinned(tab) {
return !!tab.pinned;
}
exports.isPinned = isPinned;
function reload(tab) {

Просмотреть файл

@ -327,7 +327,9 @@ function getPotentialLeaks() {
principal: details[1],
location: details[2] ? details[2].replace(/\\/g, "/") : undefined,
source: details[3] ? details[3].split(" -> ").reverse() : undefined,
toString: function() this.location
toString: function() {
return this.location;
}
};
if (!isPossibleLeak(item))
@ -351,7 +353,9 @@ function getPotentialLeaks() {
path: matches[1],
location: details[1].replace(/\\/g, "/"),
source: [details[1].replace(/\\/g, "/")],
toString: function() this.location
toString: function() {
return this.location;
}
};
if (!isPossibleLeak(item))
@ -631,7 +635,7 @@ var runTests = exports.runTests = function runTests(options) {
fileName: { value: e.fileName, writable: true, configurable: true },
lineNumber: { value: e.lineNumber, writable: true, configurable: true },
stack: { value: stack, writable: true, configurable: true },
toString: { value: function() String(e), writable: true, configurable: true },
toString: { value: () => String(e), writable: true, configurable: true },
});
print("Error: " + error + " \n " + format(error));

Просмотреть файл

@ -71,7 +71,9 @@ const ActionButton = Class({
unregister(this);
},
get id() this.state().id,
get id() {
return this.state().id;
},
click: function click() { view.click(toWidgetId(this.id)) }
});

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше