зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to graphics
MozReview-Commit-ID: HGa7QgtJVwu --HG-- rename : intl/locale/unix/nsDateTimeFormatUnix.cpp => intl/locale/DateTimeFormatUnix.cpp
This commit is contained in:
Коммит
cbfc9a8d28
|
@ -7,6 +7,7 @@ module.exports = {
|
|||
],
|
||||
"rules": {
|
||||
"mozilla/import-globals": "warn",
|
||||
"mozilla/no-import-into-var-and-global": "error",
|
||||
|
||||
// No (!foo in bar) or (!object instanceof Class)
|
||||
"no-unsafe-negation": "error",
|
||||
|
|
|
@ -80,7 +80,7 @@ void
|
|||
NotificationController::Shutdown()
|
||||
{
|
||||
if (mObservingState != eNotObservingRefresh &&
|
||||
mPresShell->RemoveRefreshObserver(this, Flush_Display)) {
|
||||
mPresShell->RemoveRefreshObserver(this, FlushType::Display)) {
|
||||
mObservingState = eNotObservingRefresh;
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ NotificationController::ScheduleProcessing()
|
|||
// If notification flush isn't planed yet start notification flush
|
||||
// asynchronously (after style and layout).
|
||||
if (mObservingState == eNotObservingRefresh) {
|
||||
if (mPresShell->AddRefreshObserver(this, Flush_Display))
|
||||
if (mPresShell->AddRefreshObserver(this, FlushType::Display))
|
||||
mObservingState = eRefreshObserving;
|
||||
}
|
||||
}
|
||||
|
@ -885,7 +885,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
mEvents.IsEmpty() && mTextHash.Count() == 0 &&
|
||||
mHangingChildDocuments.IsEmpty() &&
|
||||
mDocument->HasLoadState(DocAccessible::eCompletelyLoaded) &&
|
||||
mPresShell->RemoveRefreshObserver(this, Flush_Display)) {
|
||||
mPresShell->RemoveRefreshObserver(this, FlushType::Display)) {
|
||||
mObservingState = eNotObservingRefresh;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import "objidl.idl";
|
||||
import "oaidl.idl";
|
||||
|
||||
[object, uuid(7510360f-cdae-4de9-88c8-d167eda62afc)]
|
||||
interface IGeckoCustom : IUnknown
|
||||
{
|
||||
[propget] HRESULT ID([out, retval] unsigned __int64* aID);
|
||||
[propget] HRESULT anchorCount([out, retval] long* aCount);
|
||||
}
|
||||
|
||||
|
||||
[
|
||||
uuid(55769d85-f830-4d76-9e39-3670914a28f7),
|
||||
helpstring("private custom gecko interfaces")
|
||||
]
|
||||
library IGeckoCustom
|
||||
{
|
||||
interface IGeckoCustom;
|
||||
};
|
|
@ -0,0 +1,31 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
GARBAGE += $(MIDL_GENERATED_FILES) done_gen dlldata.c
|
||||
|
||||
MIDL_GENERATED_FILES = \
|
||||
IGeckoCustom.h \
|
||||
IGeckoCustom_p.c \
|
||||
IGeckoCustom_i.c \
|
||||
$(NULL)
|
||||
|
||||
$(MIDL_GENERATED_FILES): done_gen
|
||||
|
||||
done_gen: IGeckoCustom.idl
|
||||
$(MIDL) $(MIDL_FLAGS) -I $(srcdir) -Oicf $(srcdir)/IGeckoCustom.idl
|
||||
touch $@
|
||||
|
||||
export:: done_gen
|
||||
|
||||
midl_exports := \
|
||||
IGeckoCustom.h \
|
||||
IGeckoCustom_i.c \
|
||||
$(NULL)
|
||||
|
||||
INSTALL_TARGETS += midl_exports
|
||||
midl_exports_FILES := $(midl_exports)
|
||||
midl_exports_DEST = $(DIST)/include
|
||||
midl_exports_TARGET := midl
|
||||
|
||||
export:: midl
|
|
@ -0,0 +1,25 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
SOURCES += [
|
||||
'!dlldata.c',
|
||||
'!IGeckoCustom_i.c',
|
||||
'!IGeckoCustom_p.c',
|
||||
]
|
||||
|
||||
GENERATED_FILES += [
|
||||
'IGeckoCustom.tlb',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
# The Windows MIDL code generator creates things like:
|
||||
#
|
||||
# #endif !_MIDL_USE_GUIDDEF_
|
||||
#
|
||||
# which clang-cl complains about. MSVC doesn't, so turn this warning off.
|
||||
if CONFIG['CLANG_CL']:
|
||||
CFLAGS += ['-Wno-extra-tokens']
|
|
@ -5,7 +5,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows' and CONFIG['COMPILE_ENVIRONMENT']:
|
||||
DIRS += ['msaa', 'ia2']
|
||||
DIRS += ['gecko', 'msaa', 'ia2']
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIAccessibilityService.idl',
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "Accessible2.h"
|
||||
#include "ProxyAccessible.h"
|
||||
#include "ia2AccessibleValue.h"
|
||||
#include "IGeckoCustom.h"
|
||||
#include "mozilla/a11y/DocAccessibleParent.h"
|
||||
#include "DocAccessible.h"
|
||||
#include "mozilla/a11y/DocManager.h"
|
||||
|
@ -67,6 +68,18 @@ struct InterfaceIID<IAccessibleText>
|
|||
static REFIID Value() { return IID_IAccessibleText; }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct InterfaceIID<IAccessibleHyperlink>
|
||||
{
|
||||
static REFIID Value() { return IID_IAccessibleHyperlink; }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct InterfaceIID<IGeckoCustom>
|
||||
{
|
||||
static REFIID Value() { return IID_IGeckoCustom; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the COM proxy for this proxy accessible and QueryInterface it with the
|
||||
* correct IID
|
||||
|
@ -89,6 +102,23 @@ QueryInterface(const ProxyAccessible* aProxy)
|
|||
return acc2.forget();
|
||||
}
|
||||
|
||||
static ProxyAccessible*
|
||||
GetProxyFor(DocAccessibleParent* aDoc, IUnknown* aCOMProxy)
|
||||
{
|
||||
RefPtr<IGeckoCustom> custom;
|
||||
if (FAILED(aCOMProxy->QueryInterface(IID_IGeckoCustom,
|
||||
(void**) getter_AddRefs(custom)))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint64_t id;
|
||||
if (FAILED(custom->get_ID(&id))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return aDoc->GetAccessible(id);
|
||||
}
|
||||
|
||||
void
|
||||
ProxyAccessible::Name(nsString& aName) const
|
||||
{
|
||||
|
@ -595,5 +625,86 @@ ProxyAccessible::ScrollSubstringToPoint(int32_t aStartOffset, int32_t aEndOffset
|
|||
static_cast<long>(aY));
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ProxyAccessible::StartOffset(bool* aOk)
|
||||
{
|
||||
RefPtr<IAccessibleHyperlink> acc = QueryInterface<IAccessibleHyperlink>(this);
|
||||
if (!acc) {
|
||||
*aOk = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
long startOffset;
|
||||
*aOk = SUCCEEDED(acc->get_startIndex(&startOffset));
|
||||
return static_cast<uint32_t>(startOffset);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ProxyAccessible::EndOffset(bool* aOk)
|
||||
{
|
||||
RefPtr<IAccessibleHyperlink> acc = QueryInterface<IAccessibleHyperlink>(this);
|
||||
if (!acc) {
|
||||
*aOk = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
long endOffset;
|
||||
*aOk = SUCCEEDED(acc->get_endIndex(&endOffset));
|
||||
return static_cast<uint32_t>(endOffset);
|
||||
}
|
||||
|
||||
bool
|
||||
ProxyAccessible::IsLinkValid()
|
||||
{
|
||||
RefPtr<IAccessibleHyperlink> acc = QueryInterface<IAccessibleHyperlink>(this);
|
||||
if (!acc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean valid;
|
||||
if (FAILED(acc->get_valid(&valid))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ProxyAccessible::AnchorCount(bool* aOk)
|
||||
{
|
||||
*aOk = false;
|
||||
RefPtr<IGeckoCustom> custom = QueryInterface<IGeckoCustom>(this);
|
||||
if (!custom) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long count;
|
||||
if (FAILED(custom->get_anchorCount(&count))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*aOk = true;
|
||||
return count;
|
||||
}
|
||||
|
||||
ProxyAccessible*
|
||||
ProxyAccessible::AnchorAt(uint32_t aIdx)
|
||||
{
|
||||
RefPtr<IAccessibleHyperlink> link = QueryInterface<IAccessibleHyperlink>(this);
|
||||
if (!link) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
VARIANT anchor;
|
||||
if (FAILED(link->get_anchor(aIdx, &anchor))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(anchor.vt == VT_UNKNOWN);
|
||||
ProxyAccessible* proxyAnchor = GetProxyFor(Document(), anchor.punkVal);
|
||||
anchor.punkVal->Release();
|
||||
return proxyAnchor;
|
||||
}
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -63,8 +63,6 @@ ia2Accessible::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2Accessible::get_nRelations(long* aNRelations)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNRelations)
|
||||
return E_INVALIDARG;
|
||||
*aNRelations = 0;
|
||||
|
@ -84,16 +82,12 @@ ia2Accessible::get_nRelations(long* aNRelations)
|
|||
(*aNRelations)++;
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_relation(long aRelationIndex,
|
||||
IAccessibleRelation** aRelation)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRelation || aRelationIndex < 0)
|
||||
return E_INVALIDARG;
|
||||
*aRelation = nullptr;
|
||||
|
@ -124,8 +118,6 @@ ia2Accessible::get_relation(long aRelationIndex,
|
|||
}
|
||||
|
||||
return E_INVALIDARG;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -133,8 +125,6 @@ ia2Accessible::get_relations(long aMaxRelations,
|
|||
IAccessibleRelation** aRelation,
|
||||
long *aNRelations)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRelation || !aNRelations || aMaxRelations <= 0)
|
||||
return E_INVALIDARG;
|
||||
*aNRelations = 0;
|
||||
|
@ -160,15 +150,11 @@ ia2Accessible::get_relations(long aMaxRelations,
|
|||
}
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::role(long* aRole)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRole)
|
||||
return E_INVALIDARG;
|
||||
*aRole = 0;
|
||||
|
@ -204,15 +190,11 @@ ia2Accessible::role(long* aRole)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::scrollTo(enum IA2ScrollType aScrollType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
|
||||
if (acc->IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
@ -222,16 +204,12 @@ ia2Accessible::scrollTo(enum IA2ScrollType aScrollType)
|
|||
aScrollType);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType,
|
||||
long aX, long aY)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
|
||||
if (acc->IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
@ -244,8 +222,6 @@ ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType,
|
|||
acc->ScrollToPoint(geckoCoordType, aX, aY);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -253,8 +229,6 @@ ia2Accessible::get_groupPosition(long* aGroupLevel,
|
|||
long* aSimilarItemsInGroup,
|
||||
long* aPositionInGroup)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aGroupLevel || !aSimilarItemsInGroup || !aPositionInGroup)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -279,15 +253,11 @@ ia2Accessible::get_groupPosition(long* aGroupLevel,
|
|||
*aPositionInGroup = groupPos.posInSet;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_states(AccessibleStates* aStates)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStates)
|
||||
return E_INVALIDARG;
|
||||
*aStates = 0;
|
||||
|
@ -347,50 +317,36 @@ ia2Accessible::get_states(AccessibleStates* aStates)
|
|||
*aStates |= IA2_STATE_PINNED;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_extendedRole(BSTR* aExtendedRole)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aExtendedRole)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aExtendedRole = nullptr;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_localizedExtendedRole(BSTR* aLocalizedExtendedRole)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLocalizedExtendedRole)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aLocalizedExtendedRole = nullptr;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_nExtendedStates(long* aNExtendedStates)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNExtendedStates)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aNExtendedStates = 0;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -398,16 +354,12 @@ ia2Accessible::get_extendedStates(long aMaxExtendedStates,
|
|||
BSTR** aExtendedStates,
|
||||
long* aNExtendedStates)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aExtendedStates || !aNExtendedStates)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aExtendedStates = nullptr;
|
||||
*aNExtendedStates = 0;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -415,38 +367,28 @@ ia2Accessible::get_localizedExtendedStates(long aMaxLocalizedExtendedStates,
|
|||
BSTR** aLocalizedExtendedStates,
|
||||
long* aNLocalizedExtendedStates)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLocalizedExtendedStates || !aNLocalizedExtendedStates)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aLocalizedExtendedStates = nullptr;
|
||||
*aNLocalizedExtendedStates = 0;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_uniqueID(long* aUniqueID)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aUniqueID)
|
||||
return E_INVALIDARG;
|
||||
|
||||
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
|
||||
*aUniqueID = AccessibleWrap::GetChildIDFor(acc);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_windowHandle(HWND* aWindowHandle)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aWindowHandle)
|
||||
return E_INVALIDARG;
|
||||
*aWindowHandle = 0;
|
||||
|
@ -457,15 +399,11 @@ ia2Accessible::get_windowHandle(HWND* aWindowHandle)
|
|||
|
||||
*aWindowHandle = AccessibleWrap::GetHWNDFor(acc);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_indexInParent(long* aIndexInParent)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIndexInParent)
|
||||
return E_INVALIDARG;
|
||||
*aIndexInParent = -1;
|
||||
|
@ -481,15 +419,11 @@ ia2Accessible::get_indexInParent(long* aIndexInParent)
|
|||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_locale(IA2Locale* aLocale)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLocale)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -532,15 +466,11 @@ ia2Accessible::get_locale(IA2Locale* aLocale)
|
|||
// country abbreviations or if there are more than one subcode.
|
||||
aLocale->variant = ::SysAllocString(lang.get());
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_attributes(BSTR* aAttributes)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAttributes)
|
||||
return E_INVALIDARG;
|
||||
*aAttributes = nullptr;
|
||||
|
@ -558,8 +488,6 @@ ia2Accessible::get_attributes(BSTR* aAttributes)
|
|||
|
||||
MOZ_ASSERT(!acc->IsProxy());
|
||||
return E_UNEXPECTED;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -568,22 +496,16 @@ ia2Accessible::get_attributes(BSTR* aAttributes)
|
|||
STDMETHODIMP
|
||||
ia2Accessible::get_attribute(BSTR name, VARIANT* aAttribute)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAttribute)
|
||||
return E_INVALIDARG;
|
||||
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible,
|
||||
long* aCaretOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAccessible || !aCaretOffset)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -611,8 +533,6 @@ ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible,
|
|||
(*aAccessible)->AddRef();
|
||||
*aCaretOffset = caretOffset;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -621,8 +541,6 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType,
|
|||
IUnknown*** aTargets,
|
||||
long* aNTargets)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aTargets || !aNTargets || aMaxTargets < 0)
|
||||
return E_INVALIDARG;
|
||||
*aNTargets = 0;
|
||||
|
@ -663,16 +581,12 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2Accessible::get_selectionRanges(IA2Range** aRanges,
|
||||
long *aNRanges)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRanges || !aNRanges)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -714,8 +628,6 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -39,8 +39,6 @@ ia2AccessibleAction::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleAction::nActions(long* aActionCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aActionCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -52,30 +50,22 @@ ia2AccessibleAction::nActions(long* aActionCount)
|
|||
|
||||
*aActionCount = acc->ActionCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleAction::doAction(long aActionIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
|
||||
if (acc->IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
uint8_t index = static_cast<uint8_t>(aActionIndex);
|
||||
return acc->DoAction(index) ? S_OK : E_INVALIDARG;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aDescription)
|
||||
return E_INVALIDARG;
|
||||
*aDescription = nullptr;
|
||||
|
@ -93,8 +83,6 @@ ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
|
|||
*aDescription = ::SysAllocStringLen(description.get(),
|
||||
description.Length());
|
||||
return *aDescription ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -102,8 +90,6 @@ ia2AccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding,
|
|||
BSTR **aKeyBinding,
|
||||
long *aNumBinding)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aKeyBinding)
|
||||
return E_INVALIDARG;
|
||||
*aKeyBinding = nullptr;
|
||||
|
@ -143,15 +129,11 @@ ia2AccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding,
|
|||
|
||||
*aNumBinding = 1;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleAction::get_name(long aActionIndex, BSTR *aName)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aName)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -169,20 +151,14 @@ ia2AccessibleAction::get_name(long aActionIndex, BSTR *aName)
|
|||
|
||||
*aName = ::SysAllocStringLen(name.get(), name.Length());
|
||||
return *aName ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleAction::get_localizedName(long aActionIndex, BSTR *aLocalizedName)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLocalizedName)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aLocalizedName = nullptr;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -41,8 +41,6 @@ ia2AccessibleComponent::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleComponent::get_locationInParent(long* aX, long* aY)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aX || !aY)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -75,15 +73,11 @@ ia2AccessibleComponent::get_locationInParent(long* aX, long* aY)
|
|||
*aX = rect.x - parentRect.x;
|
||||
*aY = rect.y - parentRect.y;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleComponent::get_foreground(IA2Color* aForeground)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aForeground)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -98,15 +92,11 @@ ia2AccessibleComponent::get_foreground(IA2Color* aForeground)
|
|||
*aForeground = frame->StyleColor()->mColor;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleComponent::get_background(IA2Color* aBackground)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aBackground)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -122,7 +112,5 @@ ia2AccessibleComponent::get_background(IA2Color* aBackground)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@ using namespace mozilla::a11y;
|
|||
STDMETHODIMP
|
||||
ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -35,15 +33,11 @@ ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset)
|
|||
|
||||
textAcc->CopyText(aStartOffset, aEndOffset);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -55,15 +49,11 @@ ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset)
|
|||
|
||||
textAcc->DeleteText(aStartOffset, aEndOffset);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
uint32_t length = ::SysStringLen(*aText);
|
||||
nsAutoString text(*aText, length);
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
@ -77,15 +67,11 @@ ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText)
|
|||
|
||||
textAcc->InsertText(text, aOffset);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -97,15 +83,11 @@ ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset)
|
|||
|
||||
textAcc->CutText(aStartOffset, aEndOffset);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleEditableText::pasteText(long aOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -117,16 +99,12 @@ ia2AccessibleEditableText::pasteText(long aOffset)
|
|||
|
||||
textAcc->PasteText(aOffset);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleEditableText::replaceText(long aStartOffset, long aEndOffset,
|
||||
BSTR *aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
if (textAcc->IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
@ -141,8 +119,6 @@ ia2AccessibleEditableText::replaceText(long aStartOffset, long aEndOffset,
|
|||
textAcc->InsertText(text, aStartOffset);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
|
|
@ -45,8 +45,6 @@ ia2AccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAnchor)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -77,15 +75,11 @@ ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor)
|
|||
aAnchor->punkVal = static_cast<IUnknown*>(instancePtr);
|
||||
aAnchor->vt = VT_UNKNOWN;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAnchorTarget) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
@ -124,15 +118,11 @@ ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget)
|
|||
aAnchorTarget->bstrVal = ::SysAllocStringLen(stringURI.get(),
|
||||
stringURI.Length());
|
||||
return aAnchorTarget->bstrVal ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleHyperlink::get_startIndex(long* aIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIndex)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -149,15 +139,11 @@ ia2AccessibleHyperlink::get_startIndex(long* aIndex)
|
|||
|
||||
*aIndex = thisObj->StartOffset();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleHyperlink::get_endIndex(long* aIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIndex)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -174,15 +160,11 @@ ia2AccessibleHyperlink::get_endIndex(long* aIndex)
|
|||
|
||||
*aIndex = thisObj->EndOffset();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleHyperlink::get_valid(boolean* aValid)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aValid)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -199,7 +181,5 @@ ia2AccessibleHyperlink::get_valid(boolean* aValid)
|
|||
|
||||
*aValid = thisObj->IsLinkValid();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ using namespace mozilla::a11y;
|
|||
STDMETHODIMP
|
||||
ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aHyperlinkCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -34,16 +32,12 @@ ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount)
|
|||
|
||||
*aHyperlinkCount = hyperText->LinkCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleHypertext::get_hyperlink(long aLinkIndex,
|
||||
IAccessibleHyperlink** aHyperlink)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aHyperlink)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -65,15 +59,11 @@ ia2AccessibleHypertext::get_hyperlink(long aLinkIndex,
|
|||
static_cast<IAccessibleHyperlink*>(hyperLink);
|
||||
(*aHyperlink)->AddRef();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex, long* aHyperlinkIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aHyperlinkIndex)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -87,7 +77,5 @@ ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex, long* aHyperlinkInde
|
|||
|
||||
*aHyperlinkIndex = hyperAcc->LinkIndexAtOffset(aCharIndex);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ ia2AccessibleImage::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleImage::get_description(BSTR* aDescription)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aDescription)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -61,8 +59,6 @@ ia2AccessibleImage::get_description(BSTR* aDescription)
|
|||
|
||||
*aDescription = ::SysAllocStringLen(description.get(), description.Length());
|
||||
return *aDescription ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -70,8 +66,6 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType,
|
|||
long* aX,
|
||||
long* aY)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aX || !aY)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -90,15 +84,11 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType,
|
|||
*aX = pos.x;
|
||||
*aY = pos.y;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aHeight || !aWidth)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -113,7 +103,5 @@ ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth)
|
|||
*aHeight = size.width;
|
||||
*aWidth = size.height;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,6 @@ IMPL_IUNKNOWN_QUERY_TAIL
|
|||
STDMETHODIMP
|
||||
ia2AccessibleRelation::get_relationType(BSTR* aRelationType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRelationType)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -51,43 +49,31 @@ ia2AccessibleRelation::get_relationType(BSTR* aRelationType)
|
|||
}
|
||||
|
||||
return *aRelationType ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleRelation::get_localizedRelationType(BSTR *aLocalizedRelationType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLocalizedRelationType)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aLocalizedRelationType = nullptr;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleRelation::get_nTargets(long *aNTargets)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNTargets)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aNTargets = mTargets.Length();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (aTargetIndex < 0 || (uint32_t)aTargetIndex >= mTargets.Length() || !aTarget)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -97,16 +83,12 @@ ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget)
|
|||
(*aTarget)->AddRef();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets,
|
||||
long *aNTargets)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNTargets || !aTargets)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -120,6 +102,4 @@ ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets,
|
|||
|
||||
*aNTargets = maxTargets;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -60,8 +60,6 @@ ia2AccessibleTable::get_accessibleAt(long aRowIdx, long aColIdx,
|
|||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_caption(IUnknown** aAccessible)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAccessible)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -75,16 +73,12 @@ ia2AccessibleTable::get_caption(IUnknown** aAccessible)
|
|||
|
||||
(*aAccessible = static_cast<IAccessible*>(caption))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_childIndex(long aRowIdx, long aColIdx,
|
||||
long* aChildIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aChildIdx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -99,15 +93,11 @@ ia2AccessibleTable::get_childIndex(long aRowIdx, long aColIdx,
|
|||
|
||||
*aChildIdx = mTable->CellIndexAt(aRowIdx, aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_columnDescription(long aColIdx, BSTR* aDescription)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aDescription)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -125,16 +115,12 @@ ia2AccessibleTable::get_columnDescription(long aColIdx, BSTR* aDescription)
|
|||
|
||||
*aDescription = ::SysAllocStringLen(descr.get(), descr.Length());
|
||||
return *aDescription ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_columnExtentAt(long aRowIdx, long aColIdx,
|
||||
long* aSpan)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aSpan)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -149,31 +135,23 @@ ia2AccessibleTable::get_columnExtentAt(long aRowIdx, long aColIdx,
|
|||
|
||||
*aSpan = mTable->ColExtentAt(aRowIdx, aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_columnHeader(IAccessibleTable** aAccessibleTable,
|
||||
long* aStartingRowIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAccessibleTable || !aStartingRowIndex)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aAccessibleTable = nullptr;
|
||||
*aStartingRowIndex = -1;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_columnIndex(long aCellIdx, long* aColIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aColIdx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -187,15 +165,11 @@ ia2AccessibleTable::get_columnIndex(long aCellIdx, long* aColIdx)
|
|||
|
||||
*aColIdx = mTable->ColIndexAt(aCellIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_nColumns(long* aColCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aColCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -205,15 +179,11 @@ ia2AccessibleTable::get_nColumns(long* aColCount)
|
|||
|
||||
*aColCount = mTable->ColCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_nRows(long* aRowCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRowCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -223,8 +193,6 @@ ia2AccessibleTable::get_nRows(long* aRowCount)
|
|||
|
||||
*aRowCount = mTable->RowCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -236,8 +204,6 @@ ia2AccessibleTable::get_nSelectedChildren(long* aChildCount)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_nSelectedColumns(long* aColCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aColCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -247,15 +213,11 @@ ia2AccessibleTable::get_nSelectedColumns(long* aColCount)
|
|||
|
||||
*aColCount = mTable->SelectedColCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_nSelectedRows(long* aRowCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRowCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -266,15 +228,11 @@ ia2AccessibleTable::get_nSelectedRows(long* aRowCount)
|
|||
*aRowCount = mTable->SelectedRowCount();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_rowDescription(long aRowIdx, BSTR* aDescription)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aDescription)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -292,15 +250,11 @@ ia2AccessibleTable::get_rowDescription(long aRowIdx, BSTR* aDescription)
|
|||
|
||||
*aDescription = ::SysAllocStringLen(descr.get(), descr.Length());
|
||||
return *aDescription ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_rowExtentAt(long aRowIdx, long aColIdx, long* aSpan)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aSpan)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -315,31 +269,23 @@ ia2AccessibleTable::get_rowExtentAt(long aRowIdx, long aColIdx, long* aSpan)
|
|||
|
||||
*aSpan = mTable->RowExtentAt(aRowIdx, aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_rowHeader(IAccessibleTable** aAccessibleTable,
|
||||
long* aStartingColumnIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAccessibleTable || !aStartingColumnIndex)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aAccessibleTable = nullptr;
|
||||
*aStartingColumnIndex = -1;
|
||||
return E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_rowIndex(long aCellIdx, long* aRowIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRowIdx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -353,16 +299,12 @@ ia2AccessibleTable::get_rowIndex(long aCellIdx, long* aRowIdx)
|
|||
|
||||
*aRowIdx = mTable->RowIndexAt(aCellIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
|
||||
long* aNChildren)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aChildren || !aNChildren)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -384,36 +326,24 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
|
|||
(*aChildren)[i] = cellIndices[i];
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_selectedColumns(long aMaxColumns, long** aColumns,
|
||||
long* aNColumns)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
return get_selectedColumns(aColumns, aNColumns);
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_selectedRows(long aMaxRows, long** aRows, long* aNRows)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
return get_selectedRows(aRows, aNRows);
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_summary(IUnknown** aAccessible)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAccessible)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -424,15 +354,11 @@ ia2AccessibleTable::get_summary(IUnknown** aAccessible)
|
|||
|
||||
*aAccessible = nullptr;
|
||||
return S_FALSE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_isColumnSelected(long aColIdx, boolean* aIsSelected)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIsSelected)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -445,15 +371,11 @@ ia2AccessibleTable::get_isColumnSelected(long aColIdx, boolean* aIsSelected)
|
|||
|
||||
*aIsSelected = mTable->IsColSelected(aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_isRowSelected(long aRowIdx, boolean* aIsSelected)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIsSelected)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -466,16 +388,12 @@ ia2AccessibleTable::get_isRowSelected(long aRowIdx, boolean* aIsSelected)
|
|||
|
||||
*aIsSelected = mTable->IsRowSelected(aRowIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_isSelected(long aRowIdx, long aColIdx,
|
||||
boolean* aIsSelected)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIsSelected)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -490,15 +408,11 @@ ia2AccessibleTable::get_isSelected(long aRowIdx, long aColIdx,
|
|||
|
||||
*aIsSelected = mTable->IsCellSelected(aRowIdx, aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::selectRow(long aRowIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!mTable)
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -507,15 +421,11 @@ ia2AccessibleTable::selectRow(long aRowIdx)
|
|||
|
||||
mTable->SelectRow(aRowIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::selectColumn(long aColIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!mTable)
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -524,15 +434,11 @@ ia2AccessibleTable::selectColumn(long aColIdx)
|
|||
|
||||
mTable->SelectCol(aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::unselectRow(long aRowIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!mTable)
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -541,15 +447,11 @@ ia2AccessibleTable::unselectRow(long aRowIdx)
|
|||
|
||||
mTable->UnselectRow(aRowIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::unselectColumn(long aColIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!mTable)
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -558,8 +460,6 @@ ia2AccessibleTable::unselectColumn(long aColIdx)
|
|||
|
||||
mTable->UnselectCol(aColIdx);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -569,8 +469,6 @@ ia2AccessibleTable::get_rowColumnExtentsAtIndex(long aCellIdx, long* aRowIdx,
|
|||
long* aColExtents,
|
||||
boolean* aIsSelected)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRowIdx || !aColIdx || !aRowExtents || !aColExtents || !aIsSelected)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -595,8 +493,6 @@ ia2AccessibleTable::get_rowColumnExtentsAtIndex(long aCellIdx, long* aRowIdx,
|
|||
*aIsSelected = mTable->IsCellSelected(rowIdx, colIdx);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -611,8 +507,6 @@ ia2AccessibleTable::get_modelChange(IA2TableModelChange* aModelChange)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_cellAt(long aRowIdx, long aColIdx, IUnknown** aCell)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCell)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -628,15 +522,11 @@ ia2AccessibleTable::get_cellAt(long aRowIdx, long aColIdx, IUnknown** aCell)
|
|||
|
||||
(*aCell = static_cast<IAccessible*>(cell))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_nSelectedCells(long* aCellCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCellCount)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -646,15 +536,11 @@ ia2AccessibleTable::get_nSelectedCells(long* aCellCount)
|
|||
|
||||
*aCellCount = mTable->SelectedCellCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCells || !aNSelectedCells)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -682,15 +568,11 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
|
|||
|
||||
*aNSelectedCells = cells.Length();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aColumns || !aNColumns)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -712,15 +594,11 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
|
|||
(*aColumns)[i] = colIndices[i];
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRows || !aNRows)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -742,6 +620,4 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
|
|||
(*aRows)[i] = rowIndices[i];
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -46,8 +46,6 @@ ia2AccessibleTableCell::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_table(IUnknown** aTable)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aTable)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -63,15 +61,11 @@ ia2AccessibleTableCell::get_table(IUnknown** aTable)
|
|||
*aTable = static_cast<IAccessible*>(wrap);
|
||||
(*aTable)->AddRef();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_columnExtent(long* aSpan)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aSpan)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -82,16 +76,12 @@ ia2AccessibleTableCell::get_columnExtent(long* aSpan)
|
|||
*aSpan = mTableCell->ColExtent();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
|
||||
long* aNColumnHeaderCells)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCellAccessibles || !aNColumnHeaderCells)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -118,15 +108,11 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_columnIndex(long* aColIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aColIdx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -136,15 +122,11 @@ ia2AccessibleTableCell::get_columnIndex(long* aColIdx)
|
|||
|
||||
*aColIdx = mTableCell->ColIdx();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_rowExtent(long* aSpan)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aSpan)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -154,16 +136,12 @@ ia2AccessibleTableCell::get_rowExtent(long* aSpan)
|
|||
|
||||
*aSpan = mTableCell->RowExtent();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
|
||||
long* aNRowHeaderCells)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCellAccessibles || !aNRowHeaderCells)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -189,15 +167,11 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_rowIndex(long* aRowIdx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRowIdx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -207,8 +181,6 @@ ia2AccessibleTableCell::get_rowIndex(long* aRowIdx)
|
|||
|
||||
*aRowIdx = mTableCell->RowIdx();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -217,8 +189,6 @@ ia2AccessibleTableCell::get_rowColumnExtents(long* aRowIdx, long* aColIdx,
|
|||
long* aColExtents,
|
||||
boolean* aIsSelected)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRowIdx || !aColIdx || !aRowExtents || !aColExtents || !aIsSelected)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -234,15 +204,11 @@ ia2AccessibleTableCell::get_rowColumnExtents(long* aRowIdx, long* aColIdx,
|
|||
*aIsSelected = mTableCell->Selected();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleTableCell::get_isSelected(boolean* aIsSelected)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aIsSelected)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -252,6 +218,4 @@ ia2AccessibleTableCell::get_isSelected(boolean* aIsSelected)
|
|||
|
||||
*aIsSelected = mTableCell->Selected();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -28,8 +28,6 @@ bool ia2AccessibleText::sLastTextChangeWasInsert = false;
|
|||
STDMETHODIMP
|
||||
ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -38,16 +36,12 @@ ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset)
|
|||
|
||||
return textAcc->AddToSelection(aStartOffset, aEndOffset) ?
|
||||
S_OK : E_INVALIDARG;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
|
||||
long *aEndOffset, BSTR *aTextAttributes)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStartOffset || !aEndOffset || !aTextAttributes)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -74,15 +68,11 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
|
|||
*aEndOffset = endOffset;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_caretOffset(long *aOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aOffset)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -97,8 +87,6 @@ ia2AccessibleText::get_caretOffset(long *aOffset)
|
|||
*aOffset = textAcc->CaretOffset();
|
||||
|
||||
return *aOffset != -1 ? S_OK : S_FALSE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -107,8 +95,6 @@ ia2AccessibleText::get_characterExtents(long aOffset,
|
|||
long* aX, long* aY,
|
||||
long* aWidth, long* aHeight)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aX || !aY || !aWidth || !aHeight)
|
||||
return E_INVALIDARG;
|
||||
*aX = *aY = *aWidth = *aHeight = 0;
|
||||
|
@ -129,15 +115,11 @@ ia2AccessibleText::get_characterExtents(long aOffset,
|
|||
*aWidth = rect.width;
|
||||
*aHeight = rect.height;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_nSelections(long* aNSelections)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNSelections)
|
||||
return E_INVALIDARG;
|
||||
*aNSelections = 0;
|
||||
|
@ -151,8 +133,6 @@ ia2AccessibleText::get_nSelections(long* aNSelections)
|
|||
*aNSelections = textAcc->SelectionCount();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -160,8 +140,6 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY,
|
|||
enum IA2CoordinateType aCoordType,
|
||||
long* aOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aOffset)
|
||||
return E_INVALIDARG;
|
||||
*aOffset = 0;
|
||||
|
@ -179,16 +157,12 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY,
|
|||
*aOffset = textAcc->OffsetAtPoint(aX, aY, geckoCoordType);
|
||||
|
||||
return *aOffset == -1 ? S_FALSE : S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset,
|
||||
long* aEndOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStartOffset || !aEndOffset)
|
||||
return E_INVALIDARG;
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
|
@ -207,15 +181,11 @@ ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset,
|
|||
*aStartOffset = startOffset;
|
||||
*aEndOffset = endOffset;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aText)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -239,8 +209,6 @@ ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText)
|
|||
|
||||
*aText = ::SysAllocStringLen(text.get(), text.Length());
|
||||
return *aText ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -249,8 +217,6 @@ ia2AccessibleText::get_textBeforeOffset(long aOffset,
|
|||
long* aStartOffset, long* aEndOffset,
|
||||
BSTR* aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStartOffset || !aEndOffset || !aText)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -287,8 +253,6 @@ ia2AccessibleText::get_textBeforeOffset(long aOffset,
|
|||
|
||||
*aText = ::SysAllocStringLen(text.get(), text.Length());
|
||||
return *aText ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -297,8 +261,6 @@ ia2AccessibleText::get_textAfterOffset(long aOffset,
|
|||
long* aStartOffset, long* aEndOffset,
|
||||
BSTR* aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStartOffset || !aEndOffset || !aText)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -335,8 +297,6 @@ ia2AccessibleText::get_textAfterOffset(long aOffset,
|
|||
|
||||
*aText = ::SysAllocStringLen(text.get(), text.Length());
|
||||
return *aText ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -345,8 +305,6 @@ ia2AccessibleText::get_textAtOffset(long aOffset,
|
|||
long* aStartOffset, long* aEndOffset,
|
||||
BSTR* aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStartOffset || !aEndOffset || !aText)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -381,15 +339,11 @@ ia2AccessibleText::get_textAtOffset(long aOffset,
|
|||
|
||||
*aText = ::SysAllocStringLen(text.get(), text.Length());
|
||||
return *aText ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::removeSelection(long aSelectionIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -398,15 +352,11 @@ ia2AccessibleText::removeSelection(long aSelectionIndex)
|
|||
|
||||
return textAcc->RemoveFromSelection(aSelectionIndex) ?
|
||||
S_OK : E_INVALIDARG;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::setCaretOffset(long aOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -418,16 +368,12 @@ ia2AccessibleText::setCaretOffset(long aOffset)
|
|||
|
||||
textAcc->SetCaretOffset(aOffset);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset,
|
||||
long aEndOffset)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -436,15 +382,11 @@ ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset,
|
|||
|
||||
return textAcc->SetSelectionBoundsAt(aSelectionIndex, aStartOffset, aEndOffset) ?
|
||||
S_OK : E_INVALIDARG;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_nCharacters(long* aNCharacters)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNCharacters)
|
||||
return E_INVALIDARG;
|
||||
*aNCharacters = 0;
|
||||
|
@ -457,16 +399,12 @@ ia2AccessibleText::get_nCharacters(long* aNCharacters)
|
|||
|
||||
*aNCharacters = textAcc->CharacterCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex,
|
||||
enum IA2ScrollType aScrollType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
MOZ_ASSERT(!HyperTextProxyFor(this));
|
||||
|
||||
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
|
||||
|
@ -478,8 +416,6 @@ ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex,
|
|||
|
||||
textAcc->ScrollSubstringTo(aStartIndex, aEndIndex, aScrollType);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -487,8 +423,6 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex,
|
|||
enum IA2CoordinateType aCoordType,
|
||||
long aX, long aY)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
|
||||
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
|
||||
nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
|
||||
|
@ -505,28 +439,18 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex,
|
|||
textAcc->ScrollSubstringToPoint(aStartIndex, aEndIndex,
|
||||
geckoCoordType, aX, aY);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_newText(IA2TextSegment *aNewText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
return GetModifiedText(true, aNewText);
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleText::get_oldText(IA2TextSegment *aOldText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
return GetModifiedText(false, aOldText);
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
// ia2AccessibleText
|
||||
|
|
|
@ -46,8 +46,6 @@ ia2AccessibleValue::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ia2AccessibleValue::get_currentValue(VARIANT* aCurrentValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCurrentValue)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -68,15 +66,11 @@ ia2AccessibleValue::get_currentValue(VARIANT* aCurrentValue)
|
|||
aCurrentValue->vt = VT_R8;
|
||||
aCurrentValue->dblVal = currentValue;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleValue::setCurrentValue(VARIANT aValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (aValue.vt != VT_R8)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -87,15 +81,11 @@ ia2AccessibleValue::setCurrentValue(VARIANT aValue)
|
|||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
return valueAcc->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aMaximumValue)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -116,15 +106,11 @@ ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue)
|
|||
aMaximumValue->vt = VT_R8;
|
||||
aMaximumValue->dblVal = maximumValue;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ia2AccessibleValue::get_minimumValue(VARIANT* aMinimumValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aMinimumValue)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -145,7 +131,5 @@ ia2AccessibleValue::get_minimumValue(VARIANT* aMinimumValue)
|
|||
aMinimumValue->vt = VT_R8;
|
||||
aMinimumValue->dblVal = minimumValue;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "DocAccessible-inl.h"
|
||||
#include "mozilla/a11y/DocAccessibleParent.h"
|
||||
#include "EnumVariant.h"
|
||||
#include "GeckoCustom.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsIAccessibleEvent.h"
|
||||
|
@ -107,8 +108,6 @@ AccessibleWrap::Shutdown()
|
|||
STDMETHODIMP
|
||||
AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!ppv)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -157,13 +156,17 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
|
|||
return hr;
|
||||
}
|
||||
|
||||
if (!*ppv && iid == IID_IGeckoCustom) {
|
||||
RefPtr<GeckoCustom> gkCrap = new GeckoCustom(this);
|
||||
gkCrap.forget(ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (nullptr == *ppv)
|
||||
return E_NOINTERFACE;
|
||||
|
||||
(reinterpret_cast<IUnknown*>(*ppv))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
@ -173,8 +176,6 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!ppdispParent)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -205,15 +206,11 @@ AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
|
|||
|
||||
*ppdispParent = NativeAccessible(xpParentAcc);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pcountChildren)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -227,8 +224,6 @@ AccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren)
|
|||
|
||||
*pcountChildren = ChildCount();
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -236,8 +231,6 @@ AccessibleWrap::get_accChild(
|
|||
/* [in] */ VARIANT varChild,
|
||||
/* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!ppdispChild)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -262,8 +255,6 @@ AccessibleWrap::get_accChild(
|
|||
|
||||
child.forget(ppdispChild);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -328,8 +319,6 @@ AccessibleWrap::get_accName(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszName)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszName || varChild.vt != VT_I4)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -358,8 +347,6 @@ AccessibleWrap::get_accName(
|
|||
if (!*pszName)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
||||
|
@ -368,8 +355,6 @@ AccessibleWrap::get_accValue(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszValue)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -398,16 +383,12 @@ AccessibleWrap::get_accValue(
|
|||
if (!*pszValue)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleWrap::get_accDescription(VARIANT varChild,
|
||||
BSTR __RPC_FAR *pszDescription)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszDescription)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -429,8 +410,6 @@ AccessibleWrap::get_accDescription(VARIANT varChild,
|
|||
*pszDescription = ::SysAllocStringLen(description.get(),
|
||||
description.Length());
|
||||
return *pszDescription ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -438,8 +417,6 @@ AccessibleWrap::get_accRole(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarRole)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pvarRole)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -529,8 +506,6 @@ AccessibleWrap::get_accRole(
|
|||
}
|
||||
|
||||
return E_FAIL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -538,8 +513,6 @@ AccessibleWrap::get_accState(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarState)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pvarState)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -571,8 +544,6 @@ AccessibleWrap::get_accState(
|
|||
nsAccUtils::To32States(state, &msaaState, nullptr);
|
||||
pvarState->lVal = msaaState;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
||||
|
@ -581,15 +552,11 @@ AccessibleWrap::get_accHelp(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszHelp)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszHelp)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*pszHelp = nullptr;
|
||||
return S_FALSE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -598,16 +565,12 @@ AccessibleWrap::get_accHelpTopic(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ long __RPC_FAR *pidTopic)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszHelpFile || !pidTopic)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*pszHelpFile = nullptr;
|
||||
*pidTopic = 0;
|
||||
return S_FALSE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -615,8 +578,6 @@ AccessibleWrap::get_accKeyboardShortcut(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszKeyboardShortcut)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszKeyboardShortcut)
|
||||
return E_INVALIDARG;
|
||||
*pszKeyboardShortcut = nullptr;
|
||||
|
@ -642,16 +603,12 @@ AccessibleWrap::get_accKeyboardShortcut(
|
|||
*pszKeyboardShortcut = ::SysAllocStringLen(shortcut.get(),
|
||||
shortcut.Length());
|
||||
return *pszKeyboardShortcut ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleWrap::get_accFocus(
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pvarChild)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -682,8 +639,6 @@ AccessibleWrap::get_accFocus(
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -720,8 +675,6 @@ private:
|
|||
STDMETHODIMP
|
||||
AccessibleEnumerator::QueryInterface(REFIID iid, void ** ppvObject)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (iid == IID_IEnumVARIANT) {
|
||||
*ppvObject = static_cast<IEnumVARIANT*>(this);
|
||||
AddRef();
|
||||
|
@ -735,15 +688,11 @@ AccessibleEnumerator::QueryInterface(REFIID iid, void ** ppvObject)
|
|||
|
||||
*ppvObject = nullptr;
|
||||
return E_NOINTERFACE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar, unsigned long FAR* pceltFetched)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
uint32_t length = mArray.Length();
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
|
@ -763,29 +712,21 @@ AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar, unsigned long
|
|||
*pceltFetched = celt;
|
||||
|
||||
return hr;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleEnumerator::Clone(IEnumVARIANT FAR* FAR* ppenum)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
*ppenum = new AccessibleEnumerator(*this);
|
||||
if (!*ppenum)
|
||||
return E_OUTOFMEMORY;
|
||||
NS_ADDREF(*ppenum);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleEnumerator::Skip(unsigned long celt)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
uint32_t length = mArray.Length();
|
||||
// Check if we can skip the requested number of elements
|
||||
if (celt > length - mCurIndex) {
|
||||
|
@ -794,8 +735,6 @@ AccessibleEnumerator::Skip(unsigned long celt)
|
|||
}
|
||||
mCurIndex += celt;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -818,8 +757,6 @@ AccessibleEnumerator::Skip(unsigned long celt)
|
|||
STDMETHODIMP
|
||||
AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pvarChildren)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -839,8 +776,6 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
|
|||
NS_ADDREF(pvarChildren->punkVal = pEnum);
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -848,8 +783,6 @@ AccessibleWrap::get_accDefaultAction(
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszDefaultAction)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pszDefaultAction)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -871,8 +804,6 @@ AccessibleWrap::get_accDefaultAction(
|
|||
*pszDefaultAction = ::SysAllocStringLen(defaultAction.get(),
|
||||
defaultAction.Length());
|
||||
return *pszDefaultAction ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -880,8 +811,6 @@ AccessibleWrap::accSelect(
|
|||
/* [in] */ long flagsSelect,
|
||||
/* [optional][in] */ VARIANT varChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
RefPtr<IAccessible> accessible;
|
||||
HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible));
|
||||
if (FAILED(hr)) {
|
||||
|
@ -923,8 +852,6 @@ AccessibleWrap::accSelect(
|
|||
}
|
||||
|
||||
return E_FAIL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -935,8 +862,6 @@ AccessibleWrap::accLocation(
|
|||
/* [out] */ long __RPC_FAR *pcyHeight,
|
||||
/* [optional][in] */ VARIANT varChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pxLeft || !pyTop || !pcxWidth || !pcyHeight)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -963,8 +888,6 @@ AccessibleWrap::accLocation(
|
|||
*pcxWidth = rect.width;
|
||||
*pcyHeight = rect.height;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -973,8 +896,6 @@ AccessibleWrap::accNavigate(
|
|||
/* [optional][in] */ VARIANT varStart,
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pvarEndUpAt)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -1057,8 +978,6 @@ AccessibleWrap::accNavigate(
|
|||
pvarEndUpAt->pdispVal = NativeAccessible(navAccessible);
|
||||
pvarEndUpAt->vt = VT_DISPATCH;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -1067,8 +986,6 @@ AccessibleWrap::accHitTest(
|
|||
/* [in] */ long yTop,
|
||||
/* [retval][out] */ VARIANT __RPC_FAR *pvarChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!pvarChild)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -1095,16 +1012,12 @@ AccessibleWrap::accHitTest(
|
|||
return S_FALSE;
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
AccessibleWrap::accDoDefaultAction(
|
||||
/* [optional][in] */ VARIANT varChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
RefPtr<IAccessible> accessible;
|
||||
HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible));
|
||||
if (FAILED(hr)) {
|
||||
|
@ -1116,8 +1029,6 @@ AccessibleWrap::accDoDefaultAction(
|
|||
}
|
||||
|
||||
return DoAction(0) ? S_OK : E_INVALIDARG;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
|
|
@ -69,8 +69,6 @@ ApplicationAccessibleWrap::QueryInterface(REFIID iid, void** ppv)
|
|||
STDMETHODIMP
|
||||
ApplicationAccessibleWrap::get_appName(BSTR* aName)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aName)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -86,15 +84,11 @@ ApplicationAccessibleWrap::get_appName(BSTR* aName)
|
|||
|
||||
*aName = ::SysAllocStringLen(name.get(), name.Length());
|
||||
return *aName ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aVersion)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -110,15 +104,11 @@ ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion)
|
|||
|
||||
*aVersion = ::SysAllocStringLen(version.get(), version.Length());
|
||||
return *aVersion ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ApplicationAccessibleWrap::get_toolkitName(BSTR* aName)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aName)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -132,15 +122,11 @@ ApplicationAccessibleWrap::get_toolkitName(BSTR* aName)
|
|||
|
||||
*aName = ::SysAllocStringLen(name.get(), name.Length());
|
||||
return *aName ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aVersion)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -156,7 +142,5 @@ ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion)
|
|||
|
||||
*aVersion = ::SysAllocStringLen(version.get(), version.Length());
|
||||
return *aVersion ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,6 @@ DocAccessibleWrap::get_accParent(
|
|||
STDMETHODIMP
|
||||
DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aValue)
|
||||
return E_INVALIDARG;
|
||||
*aValue = nullptr;
|
||||
|
@ -91,8 +89,6 @@ DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue)
|
|||
|
||||
*aValue = ::SysAllocStringLen(url.get(), url.Length());
|
||||
return *aValue ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -21,8 +21,6 @@ STDMETHODIMP
|
|||
ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems,
|
||||
ULONG FAR* aCountFetched)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aItems || !aCountFetched)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -55,15 +53,11 @@ ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems,
|
|||
(*aCountFetched) = countFetched;
|
||||
|
||||
return countFetched < aCount ? S_FALSE : S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ChildrenEnumVariant::Skip(ULONG aCount)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (mAnchorAcc->IsDefunct() || mAnchorAcc->GetChildAt(mCurIndex) != mCurAcc)
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -71,15 +65,11 @@ ChildrenEnumVariant::Skip(ULONG aCount)
|
|||
mCurAcc = mAnchorAcc->GetChildAt(mCurIndex);
|
||||
|
||||
return mCurAcc ? S_OK : S_FALSE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ChildrenEnumVariant::Reset()
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (mAnchorAcc->IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -87,15 +77,11 @@ ChildrenEnumVariant::Reset()
|
|||
mCurAcc = mAnchorAcc->GetChildAt(0);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aEnumVariant)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -103,6 +89,4 @@ ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant)
|
|||
(*aEnumVariant)->AddRef();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "GeckoCustom.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
IMPL_IUNKNOWN_QUERY_HEAD(GeckoCustom)
|
||||
IMPL_IUNKNOWN_QUERY_IFACE(IGeckoCustom)
|
||||
IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAcc)
|
||||
|
||||
HRESULT
|
||||
GeckoCustom::get_anchorCount(long* aCount)
|
||||
{
|
||||
*aCount = mAcc->AnchorCount();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
GeckoCustom::get_ID(uint64_t* aID)
|
||||
{
|
||||
*aID = mAcc->IsDoc() ? 0 : reinterpret_cast<uintptr_t>(mAcc.get());
|
||||
return S_OK;
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_a11y_GeckoCustom_h_
|
||||
#define mozilla_a11y_GeckoCustom_h_
|
||||
|
||||
#include "AccessibleWrap.h"
|
||||
#include "IUnknownImpl.h"
|
||||
#include "IGeckoCustom.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
/**
|
||||
* a dumpster to put things exposed by the xpcom API but not a windows platform
|
||||
* API for the purposes of testing.
|
||||
*/
|
||||
class GeckoCustom final : public IGeckoCustom
|
||||
{
|
||||
public:
|
||||
explicit GeckoCustom(AccessibleWrap* aAcc) : mAcc(aAcc) {}
|
||||
|
||||
// IUnknown
|
||||
DECL_IUNKNOWN
|
||||
|
||||
virtual STDMETHODIMP get_anchorCount(long* aCount);
|
||||
virtual STDMETHODIMP get_ID(uint64_t* aID);
|
||||
|
||||
private:
|
||||
GeckoCustom() = delete;
|
||||
GeckoCustom& operator =(const GeckoCustom&) = delete;
|
||||
GeckoCustom(const GeckoCustom&) = delete;
|
||||
GeckoCustom(GeckoCustom&&) = delete;
|
||||
GeckoCustom& operator=(GeckoCustom&&) = delete;
|
||||
|
||||
~GeckoCustom() { }
|
||||
|
||||
protected:
|
||||
RefPtr<AccessibleWrap> mAcc;
|
||||
};
|
||||
|
||||
} // a11y namespace
|
||||
} // mozilla namespace
|
||||
|
||||
#endif
|
|
@ -37,22 +37,5 @@ GetHRESULT(nsresult aResult)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo)
|
||||
{
|
||||
if (aCode == EXCEPTION_ACCESS_VIOLATION) {
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
// MSAA swallows crashes (because it is COM-based) but we still need to
|
||||
// learn about those crashes so we can fix them. Make sure to pass them to
|
||||
// the crash reporter.
|
||||
CrashReporter::WriteMinidumpForException(aExceptionInfo);
|
||||
#endif
|
||||
} else {
|
||||
NS_NOTREACHED("We should only be catching crash exceptions");
|
||||
}
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -79,7 +79,6 @@ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**); \
|
|||
STDMETHODIMP \
|
||||
Class::QueryInterface(REFIID aIID, void** aInstancePtr) \
|
||||
{ \
|
||||
A11Y_TRYBLOCK_BEGIN \
|
||||
if (!aInstancePtr) \
|
||||
return E_INVALIDARG; \
|
||||
*aInstancePtr = nullptr; \
|
||||
|
@ -88,17 +87,14 @@ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \
|
|||
|
||||
#define IMPL_IUNKNOWN_QUERY_TAIL \
|
||||
return hr; \
|
||||
A11Y_TRYBLOCK_END \
|
||||
}
|
||||
|
||||
#define IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(Member) \
|
||||
return Member->QueryInterface(aIID, aInstancePtr); \
|
||||
A11Y_TRYBLOCK_END \
|
||||
}
|
||||
|
||||
#define IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(BaseClass) \
|
||||
return BaseClass::QueryInterface(aIID, aInstancePtr); \
|
||||
A11Y_TRYBLOCK_END \
|
||||
}
|
||||
|
||||
#define IMPL_IUNKNOWN_QUERY_IFACE(Iface) \
|
||||
|
@ -158,21 +154,6 @@ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \
|
|||
IMPL_IUNKNOWN_QUERY_CLASS(Super2); \
|
||||
IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(Super0)
|
||||
|
||||
|
||||
/**
|
||||
* Wrap every method body by these macroses to pass exception to the crash
|
||||
* reporter.
|
||||
*/
|
||||
#define A11Y_TRYBLOCK_BEGIN \
|
||||
MOZ_SEH_TRY {
|
||||
|
||||
#define A11Y_TRYBLOCK_END \
|
||||
} MOZ_SEH_EXCEPT(mozilla::a11y::FilterExceptions(::GetExceptionCode(), \
|
||||
GetExceptionInformation())) \
|
||||
{ } \
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
|
@ -181,11 +162,6 @@ namespace a11y {
|
|||
*/
|
||||
HRESULT GetHRESULT(nsresult aResult);
|
||||
|
||||
/**
|
||||
* Used to pass an exception to the crash reporter.
|
||||
*/
|
||||
int FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo);
|
||||
|
||||
} // namespace a11y;
|
||||
} //namespace mozilla;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ UNIFIED_SOURCES += [
|
|||
'Compatibility.cpp',
|
||||
'DocAccessibleWrap.cpp',
|
||||
'EnumVariant.cpp',
|
||||
'GeckoCustom.cpp',
|
||||
'HTMLTableAccessibleWrap.cpp',
|
||||
'HTMLWin32ObjectAccessible.cpp',
|
||||
'HyperTextAccessibleWrap.cpp',
|
||||
|
|
|
@ -28,8 +28,6 @@ using namespace mozilla::a11y;
|
|||
STDMETHODIMP
|
||||
sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aInstancePtr)
|
||||
return E_FAIL;
|
||||
*aInstancePtr = nullptr;
|
||||
|
@ -53,8 +51,6 @@ sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr)
|
|||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -65,8 +61,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
|
|||
unsigned int __RPC_FAR* aUniqueID,
|
||||
unsigned short __RPC_FAR* aNodeType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNodeName || !aNameSpaceID || !aNodeValue || !aNumChildren ||
|
||||
!aUniqueID || !aNodeType)
|
||||
return E_INVALIDARG;
|
||||
|
@ -114,8 +108,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
|
|||
*aNumChildren = mNode->GetChildCount();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -125,8 +117,6 @@ sdnAccessible::get_attributes(unsigned short aMaxAttribs,
|
|||
BSTR __RPC_FAR* aAttribValues,
|
||||
unsigned short __RPC_FAR* aNumAttribs)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAttribNames || !aNameSpaceIDs || !aAttribValues || !aNumAttribs)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -159,8 +149,6 @@ sdnAccessible::get_attributes(unsigned short aMaxAttribs,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -169,8 +157,6 @@ sdnAccessible::get_attributesForNames(unsigned short aMaxAttribs,
|
|||
short __RPC_FAR* aNameSpaceID,
|
||||
BSTR __RPC_FAR* aAttribValues)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAttribNames || !aNameSpaceID || !aAttribValues)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -207,8 +193,6 @@ sdnAccessible::get_attributesForNames(unsigned short aMaxAttribs,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -218,8 +202,6 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties,
|
|||
BSTR __RPC_FAR* aStyleValues,
|
||||
unsigned short __RPC_FAR* aNumStyleProperties)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStyleProperties || aStyleValues || !aNumStyleProperties)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -257,8 +239,6 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties,
|
|||
*aNumStyleProperties = static_cast<unsigned short>(realIndex);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -267,8 +247,6 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties
|
|||
BSTR __RPC_FAR* aStyleProperties,
|
||||
BSTR __RPC_FAR* aStyleValues)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aStyleProperties || !aStyleValues)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -291,15 +269,11 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::scrollTo(boolean aScrollTopLeft)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
DocAccessible* document = GetDocument();
|
||||
if (!document) // that's IsDefunct check
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
@ -313,15 +287,11 @@ sdnAccessible::scrollTo(boolean aScrollTopLeft)
|
|||
|
||||
nsCoreUtils::ScrollTo(document->PresShell(), mNode->AsContent(), scrollType);
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNode)
|
||||
return E_INVALIDARG;
|
||||
*aNode = nullptr;
|
||||
|
@ -336,15 +306,11 @@ sdnAccessible::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNode)
|
||||
return E_INVALIDARG;
|
||||
*aNode = nullptr;
|
||||
|
@ -359,15 +325,11 @@ sdnAccessible::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNode)
|
||||
return E_INVALIDARG;
|
||||
*aNode = nullptr;
|
||||
|
@ -382,15 +344,11 @@ sdnAccessible::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNode)
|
||||
return E_INVALIDARG;
|
||||
*aNode = nullptr;
|
||||
|
@ -405,15 +363,11 @@ sdnAccessible::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNode)
|
||||
return E_INVALIDARG;
|
||||
*aNode = nullptr;
|
||||
|
@ -428,16 +382,12 @@ sdnAccessible::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_childAt(unsigned aChildIndex,
|
||||
ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNode)
|
||||
return E_INVALIDARG;
|
||||
*aNode = nullptr;
|
||||
|
@ -453,15 +403,11 @@ sdnAccessible::get_childAt(unsigned aChildIndex,
|
|||
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_innerHTML(BSTR __RPC_FAR* aInnerHTML)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aInnerHTML)
|
||||
return E_INVALIDARG;
|
||||
*aInnerHTML = nullptr;
|
||||
|
@ -482,15 +428,11 @@ sdnAccessible::get_innerHTML(BSTR __RPC_FAR* aInnerHTML)
|
|||
return E_OUTOFMEMORY;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_localInterface(void __RPC_FAR *__RPC_FAR* aLocalInterface)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLocalInterface)
|
||||
return E_INVALIDARG;
|
||||
*aLocalInterface = nullptr;
|
||||
|
@ -502,15 +444,11 @@ sdnAccessible::get_localInterface(void __RPC_FAR *__RPC_FAR* aLocalInterface)
|
|||
AddRef();
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aLanguage)
|
||||
return E_INVALIDARG;
|
||||
*aLanguage = nullptr;
|
||||
|
@ -534,6 +472,4 @@ sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage)
|
|||
return E_OUTOFMEMORY;
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -24,8 +24,6 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAccessible)
|
|||
STDMETHODIMP
|
||||
sdnDocAccessible::get_URL(BSTR __RPC_FAR* aURL)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aURL)
|
||||
return E_INVALIDARG;
|
||||
*aURL = nullptr;
|
||||
|
@ -40,15 +38,11 @@ sdnDocAccessible::get_URL(BSTR __RPC_FAR* aURL)
|
|||
|
||||
*aURL = ::SysAllocStringLen(URL.get(), URL.Length());
|
||||
return *aURL ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnDocAccessible::get_title(BSTR __RPC_FAR* aTitle)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aTitle)
|
||||
return E_INVALIDARG;
|
||||
*aTitle = nullptr;
|
||||
|
@ -60,15 +54,11 @@ sdnDocAccessible::get_title(BSTR __RPC_FAR* aTitle)
|
|||
mAccessible->Title(title);
|
||||
*aTitle = ::SysAllocStringLen(title.get(), title.Length());
|
||||
return *aTitle ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnDocAccessible::get_mimeType(BSTR __RPC_FAR* aMimeType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aMimeType)
|
||||
return E_INVALIDARG;
|
||||
*aMimeType = nullptr;
|
||||
|
@ -83,15 +73,11 @@ sdnDocAccessible::get_mimeType(BSTR __RPC_FAR* aMimeType)
|
|||
|
||||
*aMimeType = ::SysAllocStringLen(mimeType.get(), mimeType.Length());
|
||||
return *aMimeType ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnDocAccessible::get_docType(BSTR __RPC_FAR* aDocType)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aDocType)
|
||||
return E_INVALIDARG;
|
||||
*aDocType = nullptr;
|
||||
|
@ -106,16 +92,12 @@ sdnDocAccessible::get_docType(BSTR __RPC_FAR* aDocType)
|
|||
|
||||
*aDocType = ::SysAllocStringLen(docType.get(), docType.Length());
|
||||
return *aDocType ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnDocAccessible::get_nameSpaceURIForID(short aNameSpaceID,
|
||||
BSTR __RPC_FAR* aNameSpaceURI)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aNameSpaceURI)
|
||||
return E_INVALIDARG;
|
||||
*aNameSpaceURI = nullptr;
|
||||
|
@ -138,20 +120,14 @@ sdnDocAccessible::get_nameSpaceURIForID(short aNameSpaceID,
|
|||
nameSpaceURI.Length());
|
||||
|
||||
return *aNameSpaceURI ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnDocAccessible::put_alternateViewMediaTypes(BSTR __RPC_FAR* aCommaSeparatedMediaTypes)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aCommaSeparatedMediaTypes)
|
||||
return E_INVALIDARG;
|
||||
*aCommaSeparatedMediaTypes = nullptr;
|
||||
|
||||
return mAccessible->IsDefunct() ? CO_E_OBJNOTCONNECTED : E_NOTIMPL;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAccessible)
|
|||
STDMETHODIMP
|
||||
sdnTextAccessible::get_domText(BSTR __RPC_FAR* aText)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aText)
|
||||
return E_INVALIDARG;
|
||||
*aText = nullptr;
|
||||
|
@ -51,8 +49,6 @@ sdnTextAccessible::get_domText(BSTR __RPC_FAR* aText)
|
|||
|
||||
*aText = ::SysAllocStringLen(nodeValue.get(), nodeValue.Length());
|
||||
return *aText ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -63,8 +59,6 @@ sdnTextAccessible::get_clippedSubstringBounds(unsigned int aStartIndex,
|
|||
int __RPC_FAR* aWidth,
|
||||
int __RPC_FAR* aHeight)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
nscoord x = 0, y = 0, width = 0, height = 0;
|
||||
HRESULT rv = get_unclippedSubstringBounds(aStartIndex, aEndIndex,
|
||||
&x, &y, &width, &height);
|
||||
|
@ -86,8 +80,6 @@ sdnTextAccessible::get_clippedSubstringBounds(unsigned int aStartIndex,
|
|||
*aWidth = clippedRect.width;
|
||||
*aHeight = clippedRect.height;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -98,8 +90,6 @@ sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex,
|
|||
int __RPC_FAR* aWidth,
|
||||
int __RPC_FAR* aHeight)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aX || !aY || !aWidth || !aHeight)
|
||||
return E_INVALIDARG;
|
||||
*aX = *aY = *aWidth = *aHeight = 0;
|
||||
|
@ -135,16 +125,12 @@ sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex,
|
|||
*aHeight = presContext->AppUnitsToDevPixels(sum.height);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex,
|
||||
unsigned int aEndIndex)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (mAccessible->IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
|
@ -159,15 +145,11 @@ sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex,
|
|||
nsCoreUtils::ScrollSubstringTo(mAccessible->GetFrame(), range,
|
||||
nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE);
|
||||
return GetHRESULT(rv);
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aFontFamily)
|
||||
return E_INVALIDARG;
|
||||
*aFontFamily = nullptr;
|
||||
|
@ -189,8 +171,6 @@ sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily)
|
|||
|
||||
*aFontFamily = ::SysAllocStringLen(name.get(), name.Length());
|
||||
return *aFontFamily ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
|
|
|
@ -28,24 +28,18 @@ STDMETHODIMP
|
|||
uiaRawElmProvider::GetObjectForChild(long aIdChild,
|
||||
__RPC__deref_out_opt IAccessibleEx** aAccEx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAccEx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aAccEx = nullptr;
|
||||
|
||||
return mAcc->IsDefunct() ? CO_E_OBJNOTCONNECTED : S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc,
|
||||
__RPC__out long* aIdChild)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aAcc || !aIdChild)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -60,15 +54,11 @@ uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc,
|
|||
copy.forget(aAcc);
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRuntimeIds)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -81,16 +71,12 @@ uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds)
|
|||
SafeArrayPutElement(*aRuntimeIds, &i, (void*)&(ids[i]));
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimple* aRawElmProvider,
|
||||
__RPC__deref_out_opt IAccessibleEx** aAccEx)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRawElmProvider || !aAccEx)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -102,8 +88,6 @@ uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimpl
|
|||
*aAccEx = static_cast<IAccessibleEx*>(instancePtr);
|
||||
|
||||
return hr;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -112,39 +96,29 @@ uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimpl
|
|||
STDMETHODIMP
|
||||
uiaRawElmProvider::get_ProviderOptions(__RPC__out enum ProviderOptions* aOptions)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aOptions)
|
||||
return E_INVALIDARG;
|
||||
|
||||
// This method is not used with IAccessibleEx implementations.
|
||||
*aOptions = ProviderOptions_ServerSideProvider;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
uiaRawElmProvider::GetPatternProvider(PATTERNID aPatternId,
|
||||
__RPC__deref_out_opt IUnknown** aPatternProvider)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aPatternProvider)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*aPatternProvider = nullptr;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
uiaRawElmProvider::GetPropertyValue(PROPERTYID aPropertyId,
|
||||
__RPC__out VARIANT* aPropertyValue)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aPropertyValue)
|
||||
return E_INVALIDARG;
|
||||
|
||||
|
@ -226,21 +200,15 @@ uiaRawElmProvider::GetPropertyValue(PROPERTYID aPropertyId,
|
|||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
||||
STDMETHODIMP
|
||||
uiaRawElmProvider::get_HostRawElementProvider(__RPC__deref_out_opt IRawElementProviderSimple** aRawElmProvider)
|
||||
{
|
||||
A11Y_TRYBLOCK_BEGIN
|
||||
|
||||
if (!aRawElmProvider)
|
||||
return E_INVALIDARG;
|
||||
|
||||
// This method is not used with IAccessibleEx implementations.
|
||||
*aRawElmProvider = nullptr;
|
||||
return S_OK;
|
||||
|
||||
A11Y_TRYBLOCK_END
|
||||
}
|
||||
|
|
|
@ -449,7 +449,6 @@
|
|||
@RESPATH@/components/addonManager.js
|
||||
@RESPATH@/components/amContentHandler.js
|
||||
@RESPATH@/components/amInstallTrigger.js
|
||||
@RESPATH@/components/amWebInstallListener.js
|
||||
|
||||
@RESPATH@/components/OopCommandLine.js
|
||||
@RESPATH@/components/CommandLine.js
|
||||
|
|
|
@ -814,10 +814,6 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i1012" id="wxtui502n2xce9j@no14">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i83" id="flash@adobee.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
|
@ -930,6 +926,10 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i1492" id="googlotim@gmail.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="1.3.2" maxVersion="1.3.2" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i93" id="{68b8676b-99a5-46d1-b390-22411d8bcd61}">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
|
@ -2011,6 +2011,10 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i1012" id="wxtui502n2xce9j@no14">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
</emItems>
|
||||
<pluginItems>
|
||||
<pluginItem blockID="p416">
|
||||
|
|
|
@ -387,7 +387,9 @@ pref("browser.search.context.loadInBackground", false);
|
|||
// comma seperated list of of engines to hide in the search panel.
|
||||
pref("browser.search.hiddenOneOffs", "");
|
||||
|
||||
#ifndef RELEASE_OR_BETA
|
||||
pref("browser.search.reset.enabled", true);
|
||||
#endif
|
||||
|
||||
pref("browser.sessionhistory.max_entries", 50);
|
||||
|
||||
|
@ -1558,4 +1560,4 @@ pref("services.sync.validation.enabled", true);
|
|||
#endif
|
||||
|
||||
// Preferences for the form autofill system extension
|
||||
pref("browser.formautofill.enabled", false);
|
||||
pref("browser.formautofill.experimental", false);
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
</ul>
|
||||
|
||||
<div id="requestAutoSubmit" hidden="true">
|
||||
<h2>&tabCrashed.requestAutoSubmit;</h2>
|
||||
<h2>&tabCrashed.requestAutoSubmit2;</h2>
|
||||
<div class="checkbox-with-label">
|
||||
<input type="checkbox" id="autoSubmit"/>
|
||||
<label for="autoSubmit">&tabCrashed.autoSubmit;</label>
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
<div id="manage">
|
||||
<header>
|
||||
<h1>&aboutAccounts.connected;</h1>
|
||||
<div id="email"></div>
|
||||
</header>
|
||||
|
||||
|
|
Двоичные данные
browser/base/content/aboutaccounts/images/graphic_sync_intro.png
Двоичные данные
browser/base/content/aboutaccounts/images/graphic_sync_intro.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 6.3 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 13 KiB |
|
@ -110,15 +110,15 @@ header h1
|
|||
|
||||
|
||||
.graphic-sync-intro {
|
||||
background-image: url(images/graphic_sync_intro.png);
|
||||
background-image: url(chrome://browser/skin/fxa/sync-illustration.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 150px 195px;
|
||||
height: 195px;
|
||||
background-size: contain;
|
||||
height: 231px;
|
||||
width: 231px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
text-indent: 100%;
|
||||
white-space: nowrap;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.description,
|
||||
|
@ -161,6 +161,6 @@ only screen and (min-device-pixel-ratio: 2),
|
|||
only screen and ( min-resolution: 192dpi),
|
||||
only screen and ( min-resolution: 2dppx) {
|
||||
.graphic-sync-intro {
|
||||
background-image: url(images/graphic_sync_intro@2x.png);
|
||||
background-image: url(chrome://browser/skin/fxa/sync-illustration@2x.png);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ a {
|
|||
0 0 2px hsla(210,65%,9%,.1) inset,
|
||||
0 1px 0 hsla(0,0%,100%,.2);
|
||||
color: inherit;
|
||||
unicode-bidi: plaintext;
|
||||
}
|
||||
|
||||
#searchText:dir(rtl) {
|
||||
|
|
|
@ -42,8 +42,7 @@
|
|||
<div id="searchIconAndTextContainer">
|
||||
<div id="searchIcon"/>
|
||||
<input type="text" name="q" value="" id="searchText" maxlength="256"
|
||||
aria-label="&contentSearchInput.label;" autofocus="autofocus"
|
||||
dir="auto"/>
|
||||
aria-label="&contentSearchInput.label;" autofocus="autofocus"/>
|
||||
<input id="searchSubmit" type="button" onclick="onSearchSubmit(event)"
|
||||
title="&contentSearchSubmit.tooltip;"/>
|
||||
</div>
|
||||
|
|
|
@ -215,7 +215,7 @@ const gXPInstallObserver = {
|
|||
|
||||
observe(aSubject, aTopic, aData) {
|
||||
var brandBundle = document.getElementById("bundle_brand");
|
||||
var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
|
||||
var installInfo = aSubject.wrappedJSObject;
|
||||
var browser = installInfo.browser;
|
||||
|
||||
// Make sure the browser is still alive.
|
||||
|
|
|
@ -1151,8 +1151,8 @@ var gHistorySwipeAnimation = {
|
|||
};
|
||||
} finally {
|
||||
img.src = url;
|
||||
return img;
|
||||
}
|
||||
return img;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -118,7 +118,8 @@ var StarUI = {
|
|||
case KeyEvent.DOM_VK_RETURN:
|
||||
if (aEvent.target.classList.contains("expander-up") ||
|
||||
aEvent.target.classList.contains("expander-down") ||
|
||||
aEvent.target.id == "editBMPanel_newFolderButton") {
|
||||
aEvent.target.id == "editBMPanel_newFolderButton" ||
|
||||
aEvent.target.id == "editBookmarkPanelRemoveButton") {
|
||||
// XXX Why is this necessary? The defaultPrevented check should
|
||||
// be enough.
|
||||
break;
|
||||
|
|
|
@ -855,7 +855,7 @@ function _loadURIWithFlags(browser, uri, params) {
|
|||
let flags = params.flags || 0;
|
||||
let referrer = params.referrerURI;
|
||||
let referrerPolicy = ('referrerPolicy' in params ? params.referrerPolicy :
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let postData = params.postData;
|
||||
|
||||
let currentRemoteType = browser.remoteType;
|
||||
|
@ -1196,7 +1196,7 @@ var gBrowserInit = {
|
|||
}
|
||||
}
|
||||
let referrerPolicy = (window.arguments[5] != undefined ?
|
||||
window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let userContextId = (window.arguments[6] != undefined ?
|
||||
window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID);
|
||||
loadURI(uriToLoad, referrerURI, window.arguments[3] || null,
|
||||
|
@ -5014,7 +5014,7 @@ nsBrowserAccess.prototype = {
|
|||
}
|
||||
|
||||
let referrer = aOpener ? makeURI(aOpener.location.href) : null;
|
||||
let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT;
|
||||
let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET;
|
||||
if (aOpener && aOpener.document) {
|
||||
referrerPolicy = aOpener.document.referrerPolicy;
|
||||
}
|
||||
|
@ -6664,8 +6664,8 @@ var gIdentityHandler = {
|
|||
return this._identityBox = document.getElementById("identity-box");
|
||||
},
|
||||
get _identityPopupMultiView() {
|
||||
delete _identityPopupMultiView;
|
||||
return document.getElementById("identity-popup-multiView");
|
||||
delete this._identityPopupMultiView;
|
||||
return this._identityPopupMultiView = document.getElementById("identity-popup-multiView");
|
||||
},
|
||||
get _identityPopupContentHosts() {
|
||||
delete this._identityPopupContentHosts;
|
||||
|
@ -8106,6 +8106,29 @@ var PanicButtonNotifier = {
|
|||
try {
|
||||
let popup = document.getElementById("panic-button-success-notification");
|
||||
popup.hidden = false;
|
||||
// To close the popup in 3 seconds after the popup is shown but left uninteracted.
|
||||
let onTimeout = () => {
|
||||
PanicButtonNotifier.close();
|
||||
removeListeners();
|
||||
};
|
||||
popup.addEventListener("popupshown", function() {
|
||||
PanicButtonNotifier.timer = setTimeout(onTimeout, 3000);
|
||||
});
|
||||
// To prevent the popup from closing when user tries to interact with the
|
||||
// popup using mouse or keyboard.
|
||||
let onUserInteractsWithPopup = () => {
|
||||
clearTimeout(PanicButtonNotifier.timer);
|
||||
removeListeners();
|
||||
};
|
||||
popup.addEventListener("mouseover", onUserInteractsWithPopup);
|
||||
window.addEventListener("keydown", onUserInteractsWithPopup);
|
||||
let removeListeners = () => {
|
||||
popup.removeEventListener("mouseover", onUserInteractsWithPopup);
|
||||
window.removeEventListener("keydown", onUserInteractsWithPopup);
|
||||
popup.removeEventListener("popuphidden", removeListeners);
|
||||
};
|
||||
popup.addEventListener("popuphidden", removeListeners);
|
||||
|
||||
let widget = CustomizableUI.getWidget("panic-button").forWindow(window);
|
||||
let anchor = widget.anchor;
|
||||
anchor = document.getAnonymousElementByAttribute(anchor, "class", "toolbarbutton-icon");
|
||||
|
|
|
@ -372,6 +372,7 @@ body.compact #newtab-search-container {
|
|||
0 0 2px hsla(210,65%,9%,.1) inset,
|
||||
0 1px 0 hsla(0,0%,100%,.2);
|
||||
color: inherit;
|
||||
unicode-bidi: plaintext;
|
||||
}
|
||||
|
||||
#newtab-search-text:dir(rtl) {
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<div id="newtab-search-form">
|
||||
<div id="newtab-search-icon"/>
|
||||
<input type="text" name="q" value="" id="newtab-search-text"
|
||||
aria-label="&contentSearchInput.label;" maxlength="256" dir="auto"/>
|
||||
aria-label="&contentSearchInput.label;" maxlength="256"/>
|
||||
<input id="newtab-search-submit" type="button"
|
||||
title="&contentSearchSubmit.tooltip;"/>
|
||||
</div>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
/>
|
||||
|
||||
<vbox align="start">
|
||||
<checkbox label="&engine.tabs.label;"
|
||||
<checkbox label="&engine.tabs.label2;"
|
||||
accesskey="&engine.tabs.accesskey;"
|
||||
preference="engine.tabs"/>
|
||||
<checkbox label="&engine.bookmarks.label;"
|
||||
|
|
|
@ -392,7 +392,7 @@
|
|||
accesskey="&engine.history.accesskey;"
|
||||
id="engine.history"
|
||||
checked="true"/>
|
||||
<checkbox label="&engine.tabs.label;"
|
||||
<checkbox label="&engine.tabs.label2;"
|
||||
accesskey="&engine.tabs.accesskey;"
|
||||
id="engine.tabs"
|
||||
checked="true"/>
|
||||
|
|
|
@ -4846,7 +4846,7 @@
|
|||
|
||||
let newTab = this.loadOneTab(data.href, {
|
||||
referrerURI: (data.referrer ? makeURI(data.referrer) : null),
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
postData: null,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
|
|
|
@ -405,7 +405,7 @@ skip-if = os == 'linux' # Bug 1304272
|
|||
[browser_tab_detach_restore.js]
|
||||
[browser_tab_drag_drop_perwindow.js]
|
||||
[browser_tab_dragdrop.js]
|
||||
skip-if = buildapp == 'mulet' || (e10s && debug) # Bug 1312436
|
||||
skip-if = buildapp == 'mulet' || (e10s && (debug || asan)) # Bug 1312436
|
||||
[browser_tab_dragdrop2.js]
|
||||
[browser_tabbar_big_widgets.js]
|
||||
skip-if = os == "linux" || os == "mac" # No tabs in titlebar on linux
|
||||
|
|
|
@ -254,6 +254,30 @@ add_task(function* ctrl_d_edit_bookmark_remove_bookmark() {
|
|||
});
|
||||
});
|
||||
|
||||
add_task(function* enter_on_remove_bookmark_should_remove_bookmark() {
|
||||
if (AppConstants.platform == "macosx") {
|
||||
// "Full Keyboard Access" is disabled by default, and thus doesn't allow
|
||||
// keyboard navigation to the "Remove Bookmarks" button by default.
|
||||
return;
|
||||
}
|
||||
|
||||
yield test_bookmarks_popup({
|
||||
isNewBookmark: true,
|
||||
popupShowFn(browser) {
|
||||
EventUtils.synthesizeKey("D", {accelKey: true}, window);
|
||||
},
|
||||
shouldAutoClose: true,
|
||||
popupHideFn() {
|
||||
while (!document.activeElement ||
|
||||
document.activeElement.id != "editBookmarkPanelRemoveButton") {
|
||||
EventUtils.sendChar("VK_TAB", window);
|
||||
}
|
||||
EventUtils.sendChar("VK_RETURN", window);
|
||||
},
|
||||
isBookmarkRemoved: true,
|
||||
});
|
||||
});
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
delete StarUI._closePanelQuickForTesting;
|
||||
})
|
||||
|
|
|
@ -470,46 +470,6 @@ function test_restartless() {
|
|||
});
|
||||
},
|
||||
|
||||
function test_multiple() {
|
||||
return Task.spawn(function* () {
|
||||
let pm = Services.perms;
|
||||
pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
|
||||
|
||||
let progressPromise = waitForProgressNotification();
|
||||
let dialogPromise = waitForInstallDialog();
|
||||
let triggers = encodeURIComponent(JSON.stringify({
|
||||
"Unsigned XPI": "amosigned.xpi",
|
||||
"Restartless XPI": "restartless.xpi"
|
||||
}));
|
||||
BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
|
||||
let panel = yield progressPromise;
|
||||
let installDialog = yield dialogPromise;
|
||||
|
||||
let notificationPromise = waitForNotification("addon-install-restart");
|
||||
acceptInstallDialog(installDialog);
|
||||
yield notificationPromise;
|
||||
|
||||
let notification = panel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
"2 add-ons will be installed after you restart " + gApp + ".",
|
||||
"Should have seen the right message");
|
||||
|
||||
let installs = yield getInstalls();
|
||||
is(installs.length, 1, "Should be one pending install");
|
||||
installs[0].cancel();
|
||||
|
||||
let addon = yield new Promise(resolve => {
|
||||
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
|
||||
resolve(result);
|
||||
});
|
||||
});
|
||||
addon.uninstall();
|
||||
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||
yield removeTab();
|
||||
});
|
||||
},
|
||||
|
||||
function test_sequential() {
|
||||
return Task.spawn(function* () {
|
||||
// This test is only relevant if using the new doorhanger UI
|
||||
|
@ -586,64 +546,6 @@ function test_sequential() {
|
|||
});
|
||||
},
|
||||
|
||||
function test_someUnverified() {
|
||||
return Task.spawn(function* () {
|
||||
// This test is only relevant if using the new doorhanger UI and allowing
|
||||
// unsigned add-ons
|
||||
if (!Preferences.get("xpinstall.customConfirmationUI", false) ||
|
||||
Preferences.get("xpinstall.signatures.required", true) ||
|
||||
REQUIRE_SIGNING) {
|
||||
return;
|
||||
}
|
||||
let pm = Services.perms;
|
||||
pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
|
||||
|
||||
let progressPromise = waitForProgressNotification();
|
||||
let dialogPromise = waitForInstallDialog();
|
||||
let triggers = encodeURIComponent(JSON.stringify({
|
||||
"Extension XPI": "restartless-unsigned.xpi",
|
||||
"Theme XPI": "theme.xpi"
|
||||
}));
|
||||
BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
|
||||
yield progressPromise;
|
||||
let installDialog = yield dialogPromise;
|
||||
|
||||
let notification = document.getElementById("addon-install-confirmation-notification");
|
||||
let message = notification.getAttribute("label");
|
||||
is(message, "Caution: This site would like to install 2 add-ons in " + gApp +
|
||||
", some of which are unverified. Proceed at your own risk.",
|
||||
"Should see the right message");
|
||||
|
||||
let container = document.getElementById("addon-install-confirmation-content");
|
||||
is(container.childNodes.length, 2, "Should be two items listed");
|
||||
is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
|
||||
is(container.childNodes[0].lastChild.getAttribute("class"),
|
||||
"addon-install-confirmation-unsigned", "Should have the unverified marker");
|
||||
is(container.childNodes[1].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
|
||||
is(container.childNodes[1].childNodes.length, 1, "Shouldn't have the unverified marker");
|
||||
|
||||
let notificationPromise = waitForNotification("addon-install-restart");
|
||||
acceptInstallDialog(installDialog);
|
||||
yield notificationPromise;
|
||||
|
||||
let [addon, theme] = yield new Promise(resolve => {
|
||||
AddonManager.getAddonsByIDs(["restartless-xpi@tests.mozilla.org",
|
||||
"theme-xpi@tests.mozilla.org"],
|
||||
function(addons) {
|
||||
resolve(addons);
|
||||
});
|
||||
});
|
||||
addon.uninstall();
|
||||
// Installing a new theme tries to switch to it, switch back to the
|
||||
// default theme.
|
||||
theme.userDisabled = true;
|
||||
theme.uninstall();
|
||||
|
||||
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||
yield removeTab();
|
||||
});
|
||||
},
|
||||
|
||||
function test_allUnverified() {
|
||||
return Task.spawn(function* () {
|
||||
// This test is only relevant if using the new doorhanger UI and allowing
|
||||
|
|
|
@ -62,7 +62,7 @@ add_task(function* () {
|
|||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
|
||||
// Set up the grouped SHEntry setup
|
||||
let tab2 = gBrowser.loadOneTab("data:text/html,b", {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -16,6 +16,8 @@ skip-if = (os == "linux" && (debug || asan))
|
|||
skip-if = (os == "linux" && (debug || asan))
|
||||
[browser_popupNotification_checkbox.js]
|
||||
skip-if = (os == "linux" && (debug || asan))
|
||||
[browser_popupNotification_keyboard.js]
|
||||
skip-if = (os == "linux" && (debug || asan))
|
||||
[browser_popupNotification_no_anchors.js]
|
||||
skip-if = (os == "linux" && (debug || asan))
|
||||
[browser_reshow_in_background.js]
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
ok(PopupNotifications, "PopupNotifications object exists");
|
||||
ok(PopupNotifications.panel, "PopupNotifications panel exists");
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
var tests = [
|
||||
// Test that for persistent notifications,
|
||||
// the secondary action is triggered by pressing the escape key.
|
||||
{ id: "Test#1",
|
||||
run() {
|
||||
this.notifyObj = new BasicNotification(this.id);
|
||||
this.notifyObj.options.persistent = true;
|
||||
showNotification(this.notifyObj);
|
||||
},
|
||||
onShown(popup) {
|
||||
checkPopup(popup, this.notifyObj);
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", {});
|
||||
},
|
||||
onHidden(popup) {
|
||||
ok(!this.notifyObj.mainActionClicked, "mainAction was not clicked");
|
||||
ok(this.notifyObj.secondaryActionClicked, "secondaryAction was clicked");
|
||||
ok(!this.notifyObj.dismissalCallbackTriggered, "dismissal callback wasn't triggered");
|
||||
ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered");
|
||||
}
|
||||
},
|
||||
// Test that for non-persistent notifications, the escape key dismisses the notification.
|
||||
{ id: "Test#2",
|
||||
*run() {
|
||||
yield waitForWindowReadyForPopupNotifications(window);
|
||||
this.notifyObj = new BasicNotification(this.id);
|
||||
this.notification = showNotification(this.notifyObj);
|
||||
},
|
||||
onShown(popup) {
|
||||
checkPopup(popup, this.notifyObj);
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", {});
|
||||
},
|
||||
onHidden(popup) {
|
||||
ok(!this.notifyObj.mainActionClicked, "mainAction was not clicked");
|
||||
ok(!this.notifyObj.secondaryActionClicked, "secondaryAction was not clicked");
|
||||
ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered");
|
||||
ok(!this.notifyObj.removedCallbackTriggered, "removed callback was not triggered");
|
||||
this.notification.remove();
|
||||
}
|
||||
},
|
||||
];
|
|
@ -36,7 +36,6 @@ support-files =
|
|||
[browser_canonizeURL.js]
|
||||
[browser_dragdropURL.js]
|
||||
[browser_locationBarCommand.js]
|
||||
skip-if = true # bug 917535, bug 1289765
|
||||
[browser_locationBarExternalLoad.js]
|
||||
[browser_moz_action_link.js]
|
||||
[browser_pasteAndGo.js]
|
||||
|
|
|
@ -90,7 +90,7 @@ function openUILink(url, event, aIgnoreButton, aIgnoreAlt, aAllowThirdPartyFixup
|
|||
allowThirdPartyFixup: aAllowThirdPartyFixup,
|
||||
postData: aPostData,
|
||||
referrerURI: aReferrerURI,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
initiatingDoc: event ? event.target.ownerDocument : null,
|
||||
};
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
|
|||
allowThirdPartyFixup: aAllowThirdPartyFixup,
|
||||
postData: aPostData,
|
||||
referrerURI: aReferrerURI,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Components.interfaces.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ function openLinkIn(url, where, params) {
|
|||
var aCharset = params.charset;
|
||||
var aReferrerURI = params.referrerURI;
|
||||
var aReferrerPolicy = ('referrerPolicy' in params ?
|
||||
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
var aRelatedToCurrent = params.relatedToCurrent;
|
||||
var aAllowMixedContent = params.allowMixedContent;
|
||||
var aInBackground = params.inBackground;
|
||||
|
|
|
@ -56,8 +56,6 @@ browser.jar:
|
|||
content/browser/aboutaccounts/main.css (content/aboutaccounts/main.css)
|
||||
content/browser/aboutaccounts/normalize.css (content/aboutaccounts/normalize.css)
|
||||
content/browser/aboutaccounts/images/fox.png (content/aboutaccounts/images/fox.png)
|
||||
content/browser/aboutaccounts/images/graphic_sync_intro.png (content/aboutaccounts/images/graphic_sync_intro.png)
|
||||
content/browser/aboutaccounts/images/graphic_sync_intro@2x.png (content/aboutaccounts/images/graphic_sync_intro@2x.png)
|
||||
|
||||
|
||||
content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
|
||||
|
|
|
@ -70,3 +70,4 @@ support-files =
|
|||
[browser_clientAuth.js]
|
||||
[browser_cacheAPI.js]
|
||||
[browser_permissions.js]
|
||||
[browser_sanitize.js]
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
/**
|
||||
* Bug 1270338 - Add a mochitest to ensure Sanitizer clears data for all containers
|
||||
*/
|
||||
|
||||
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
|
||||
|
||||
const TEST_DOMAIN = "http://example.net/";
|
||||
|
||||
let tempScope = {};
|
||||
Services.scriptloader.loadSubScript("chrome://browser/content/sanitize.js",
|
||||
tempScope);
|
||||
let Sanitizer = tempScope.Sanitizer;
|
||||
|
||||
function setCookies(aBrowser) {
|
||||
ContentTask.spawn(aBrowser, null, function() {
|
||||
content.document.cookie = "key=value";
|
||||
});
|
||||
}
|
||||
|
||||
function cacheDataForContext(loadContextInfo) {
|
||||
return new Promise(resolve => {
|
||||
let cachedURIs = [];
|
||||
let cacheVisitor = {
|
||||
onCacheStorageInfo(num, consumption) {},
|
||||
onCacheEntryInfo(uri, idEnhance) {
|
||||
cachedURIs.push(uri.asciiSpec);
|
||||
},
|
||||
onCacheEntryVisitCompleted() {
|
||||
resolve(cachedURIs);
|
||||
},
|
||||
QueryInterface(iid) {
|
||||
if (iid.equals(Ci.nsICacheStorageVisitor))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
};
|
||||
// Visiting the disk cache also visits memory storage so we do not
|
||||
// need to use Services.cache2.memoryCacheStorage() here.
|
||||
let storage = Services.cache2.diskCacheStorage(loadContextInfo, false);
|
||||
storage.asyncVisitStorage(cacheVisitor, true);
|
||||
});
|
||||
}
|
||||
|
||||
function checkCookiesSanitized(aBrowser) {
|
||||
ContentTask.spawn(aBrowser, null, function() {
|
||||
is(content.document.cookie, "",
|
||||
"Cookies of all origin attributes should be cleared.");
|
||||
});
|
||||
}
|
||||
|
||||
function checkCacheExists(aShouldExist) {
|
||||
return function* () {
|
||||
let loadContextInfos = [
|
||||
LoadContextInfo.default,
|
||||
LoadContextInfo.custom(false, { userContextId: 1 }),
|
||||
LoadContextInfo.custom(false, { userContextId: 2 }),
|
||||
LoadContextInfo.custom(false, { firstPartyDomain: "example.com" }),
|
||||
LoadContextInfo.custom(false, { firstPartyDomain: "example.org" }),
|
||||
];
|
||||
let i = 0;
|
||||
for (let loadContextInfo of loadContextInfos) {
|
||||
let cacheURIs = yield cacheDataForContext(loadContextInfo);
|
||||
is(cacheURIs.includes(TEST_DOMAIN), aShouldExist, TEST_DOMAIN + " should "
|
||||
+ (aShouldExist ? "not " : "") + "be cached for all origin attributes." + i++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_task(function* setup() {
|
||||
let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
|
||||
.getService(Ci.nsICacheStorageService);
|
||||
networkCache.clear();
|
||||
});
|
||||
|
||||
// This will set the cookies and the cache.
|
||||
IsolationTestTools.runTests(TEST_DOMAIN, setCookies, () => true);
|
||||
|
||||
add_task(checkCacheExists(true));
|
||||
|
||||
add_task(function* sanitize() {
|
||||
let sanitizer = new Sanitizer();
|
||||
yield sanitizer.sanitize(["cookies", "cache"]);
|
||||
});
|
||||
|
||||
add_task(checkCacheExists(false));
|
||||
IsolationTestTools.runTests(TEST_DOMAIN, checkCookiesSanitized, () => true);
|
|
@ -173,30 +173,28 @@ this.IsolationTestTools = {
|
|||
* The testing task which will be run in different settings.
|
||||
*/
|
||||
_add_task(aTask) {
|
||||
add_task(function* addTaskForIsolationTests() {
|
||||
let testSettings = [
|
||||
{ mode: TEST_MODE_FIRSTPARTY,
|
||||
skip: false,
|
||||
prefs: [["privacy.firstparty.isolate", true]]
|
||||
},
|
||||
{ mode: TEST_MODE_NO_ISOLATION,
|
||||
skip: false,
|
||||
prefs: [["privacy.firstparty.isolate", false]]
|
||||
},
|
||||
{ mode: TEST_MODE_CONTAINERS,
|
||||
skip: false,
|
||||
prefs: [["privacy.userContext.enabled", true]]
|
||||
},
|
||||
];
|
||||
let testSettings = [
|
||||
{ mode: TEST_MODE_FIRSTPARTY,
|
||||
skip: false,
|
||||
prefs: [["privacy.firstparty.isolate", true]]
|
||||
},
|
||||
{ mode: TEST_MODE_NO_ISOLATION,
|
||||
skip: false,
|
||||
prefs: [["privacy.firstparty.isolate", false]]
|
||||
},
|
||||
{ mode: TEST_MODE_CONTAINERS,
|
||||
skip: false,
|
||||
prefs: [["privacy.userContext.enabled", true]]
|
||||
},
|
||||
];
|
||||
|
||||
// Add test tasks.
|
||||
for (let testSetting of testSettings) {
|
||||
IsolationTestTools._addTaskForMode(testSetting.mode,
|
||||
testSetting.prefs,
|
||||
testSetting.skip,
|
||||
aTask);
|
||||
}
|
||||
});
|
||||
// Add test tasks.
|
||||
for (let testSetting of testSettings) {
|
||||
IsolationTestTools._addTaskForMode(testSetting.mode,
|
||||
testSetting.prefs,
|
||||
testSetting.skip,
|
||||
aTask);
|
||||
}
|
||||
},
|
||||
|
||||
_addTaskForMode(aMode, aPref, aSkip, aTask) {
|
||||
|
|
|
@ -228,7 +228,7 @@ var gAdvancedPane = {
|
|||
* sync its new value to the gfx.direct2d.disabled pref too.
|
||||
*/
|
||||
updateHardwareAcceleration() {
|
||||
if (AppConstants.platform = "win") {
|
||||
if (AppConstants.platform == "win") {
|
||||
var fromPref = document.getElementById("layers.acceleration.disabled");
|
||||
var toPref = document.getElementById("gfx.direct2d.disabled");
|
||||
toPref.value = fromPref.value;
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
preference="engine.history"/>
|
||||
</richlistitem>
|
||||
<richlistitem>
|
||||
<checkbox label="&engine.tabs.label;"
|
||||
<checkbox label="&engine.tabs.label2;"
|
||||
accesskey="&engine.tabs.accesskey;"
|
||||
preference="engine.tabs"/>
|
||||
</richlistitem>
|
||||
|
@ -254,8 +254,8 @@
|
|||
</description>
|
||||
</hbox>
|
||||
<hbox class="fxaAccountBoxButtons">
|
||||
<button id="verifyFxaAccount" accesskey="&verify.accesskey;">&verify.label;</button>
|
||||
<button id="unverifiedUnlinkFxaAccount" accesskey="&forget.accesskey;">&forget.label;</button>
|
||||
<button id="verifyFxaAccount" label="&verify.label;" accesskey="&verify.accesskey;"></button>
|
||||
<button id="unverifiedUnlinkFxaAccount" label="&forget.label;" accesskey="&forget.accesskey;"></button>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
@ -275,8 +275,8 @@
|
|||
</description>
|
||||
</hbox>
|
||||
<hbox class="fxaAccountBoxButtons">
|
||||
<button id="rejectReSignIn" accessky="&signIn.accesskey;">&signIn.label;</button>
|
||||
<button id="rejectUnlinkFxaAccount" accesskey="&forget.accesskey;">&forget.label;</button>
|
||||
<button id="rejectReSignIn" label="&signIn.label;" accesskey="&signIn.accesskey;"></button>
|
||||
<button id="rejectUnlinkFxaAccount" label="&forget.label;" accesskey="&forget.accesskey;"></button>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
@ -286,7 +286,7 @@
|
|||
<caption><label>&signedIn.engines.label;</label></caption>
|
||||
<hbox id="fxaSyncEngines">
|
||||
<vbox align="start" flex="1">
|
||||
<checkbox label="&engine.tabs.label;"
|
||||
<checkbox label="&engine.tabs.label2;"
|
||||
accesskey="&engine.tabs.accesskey;"
|
||||
preference="engine.tabs"/>
|
||||
<checkbox label="&engine.bookmarks.label;"
|
||||
|
|
|
@ -23,6 +23,8 @@ support-files =
|
|||
[browser_contextmenu.js]
|
||||
[browser_contextSearchTabPosition.js]
|
||||
skip-if = os == "mac" # bug 967013
|
||||
[browser_ddg.js]
|
||||
[browser_ddg_behavior.js]
|
||||
[browser_google.js]
|
||||
[browser_google_codes.js]
|
||||
[browser_google_behavior.js]
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,165 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* Test DuckDuckGo search plugin URLs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const BROWSER_SEARCH_PREF = "browser.search.";
|
||||
|
||||
|
||||
function test() {
|
||||
let engine = Services.search.getEngineByName("DuckDuckGo");
|
||||
ok(engine, "DuckDuckGo is installed");
|
||||
|
||||
let previouslySelectedEngine = Services.search.currentEngine;
|
||||
Services.search.currentEngine = engine;
|
||||
engine.alias = "d";
|
||||
|
||||
let base = "https://duckduckgo.com/?q=foo";
|
||||
let url;
|
||||
|
||||
// Test search URLs (including purposes).
|
||||
url = engine.getSubmission("foo").uri.spec;
|
||||
is(url, base + "&t=ffsb", "Check search URL for 'foo'");
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
var gCurrTest;
|
||||
var gTests = [
|
||||
{
|
||||
name: "context menu search",
|
||||
searchURL: base + "&t=ffcm",
|
||||
run() {
|
||||
// Simulate a contextmenu search
|
||||
// FIXME: This is a bit "low-level"...
|
||||
BrowserSearch.loadSearch("foo", false, "contextmenu");
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "keyword search",
|
||||
searchURL: base + "&t=ffab",
|
||||
run() {
|
||||
gURLBar.value = "? foo";
|
||||
gURLBar.focus();
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "keyword search with alias",
|
||||
searchURL: base + "&t=ffab",
|
||||
run() {
|
||||
gURLBar.value = "d foo";
|
||||
gURLBar.focus();
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "search bar search",
|
||||
searchURL: base + "&t=ffsb",
|
||||
run() {
|
||||
let sb = BrowserSearch.searchBar;
|
||||
sb.focus();
|
||||
sb.value = "foo";
|
||||
registerCleanupFunction(function() {
|
||||
sb.value = "";
|
||||
});
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "new tab search",
|
||||
searchURL: base + "&t=ffnt",
|
||||
run() {
|
||||
function doSearch(doc) {
|
||||
// Re-add the listener, and perform a search
|
||||
gBrowser.addProgressListener(listener);
|
||||
doc.getElementById("newtab-search-text").value = "foo";
|
||||
doc.getElementById("newtab-search-submit").click();
|
||||
}
|
||||
|
||||
// load about:newtab, but remove the listener first so it doesn't
|
||||
// get in the way
|
||||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.loadURI("about:newtab");
|
||||
info("Waiting for about:newtab load");
|
||||
tab.linkedBrowser.addEventListener("load", function load(loadEvent) {
|
||||
if (loadEvent.originalTarget != tab.linkedBrowser.contentDocumentAsCPOW ||
|
||||
loadEvent.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
tab.linkedBrowser.removeEventListener("load", load, true);
|
||||
|
||||
// Observe page setup
|
||||
let win = gBrowser.contentWindowAsCPOW;
|
||||
if (win.gSearch.currentEngineName ==
|
||||
Services.search.currentEngine.name) {
|
||||
doSearch(win.document);
|
||||
} else {
|
||||
info("Waiting for newtab search init");
|
||||
win.addEventListener("ContentSearchService", function done(contentSearchServiceEvent) {
|
||||
info("Got newtab search event " + contentSearchServiceEvent.detail.type);
|
||||
if (contentSearchServiceEvent.detail.type == "State") {
|
||||
win.removeEventListener("ContentSearchService", done);
|
||||
// Let gSearch respond to the event before continuing.
|
||||
executeSoon(() => doSearch(win.document));
|
||||
}
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
function nextTest() {
|
||||
if (gTests.length) {
|
||||
gCurrTest = gTests.shift();
|
||||
info("Running : " + gCurrTest.name);
|
||||
executeSoon(gCurrTest.run);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
let listener = {
|
||||
onStateChange: function onStateChange(webProgress, req, flags, status) {
|
||||
info("onStateChange");
|
||||
// Only care about top-level document starts
|
||||
let docStart = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT |
|
||||
Ci.nsIWebProgressListener.STATE_START;
|
||||
if (!(flags & docStart) || !webProgress.isTopLevel)
|
||||
return;
|
||||
|
||||
if (req.originalURI.spec == "about:blank")
|
||||
return;
|
||||
|
||||
info("received document start");
|
||||
|
||||
ok(req instanceof Ci.nsIChannel, "req is a channel");
|
||||
is(req.originalURI.spec, gCurrTest.searchURL, "search URL was loaded");
|
||||
info("Actual URI: " + req.URI.spec);
|
||||
|
||||
req.cancel(Components.results.NS_ERROR_FAILURE);
|
||||
|
||||
executeSoon(nextTest);
|
||||
}
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
engine.alias = undefined;
|
||||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.removeTab(tab);
|
||||
Services.search.currentEngine = previouslySelectedEngine;
|
||||
});
|
||||
|
||||
tab.linkedBrowser.addEventListener("load", function load() {
|
||||
tab.linkedBrowser.removeEventListener("load", load, true);
|
||||
gBrowser.addProgressListener(listener);
|
||||
nextTest();
|
||||
}, true);
|
||||
}
|
|
@ -201,7 +201,7 @@ ContentRestoreInternal.prototype = {
|
|||
Utils.makeURI(loadArguments.referrer) : null;
|
||||
let referrerPolicy = ('referrerPolicy' in loadArguments
|
||||
? loadArguments.referrerPolicy
|
||||
: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
|
||||
: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let postData = loadArguments.postData ?
|
||||
Utils.makeInputStream(loadArguments.postData) : null;
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ add_task(function* () {
|
|||
|
||||
// Create a new hidden prerendered tab to swap to.
|
||||
let tab2 = gBrowser.loadOneTab(URIs[2], {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
@ -106,7 +106,7 @@ add_task(function* () {
|
|||
|
||||
// Create a new hidden prerendered tab to swap to
|
||||
let tab3 = gBrowser.loadOneTab(URIs[4], {
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
allowThirdPartyFixup: true,
|
||||
relatedToCurrent: true,
|
||||
isPrerendered: true,
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
[
|
||||
{
|
||||
"version": "clang 3.8.0, libgcc 4.9.4 + PR64905",
|
||||
"size": 155933720,
|
||||
"digest": "7a3a9a5ff455554d120596fe4bc06c19e41ecbd1e67b1e95e778c0b8ce6d9472f30fd4a27c66d48d9c047aac7a077f23f87397711dd6f33175f95cf4a2ada862",
|
||||
"algorithm": "sha512",
|
||||
"filename": "clang.tar.xz",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
"version": "gcc 4.9.4 + PR64905",
|
||||
"size": 101297752,
|
||||
"digest": "42aa2e3fdd232b5e390472a788e7f7db71a1fee4221e260b6cb58c9a1d73e6cdd10afcbac137f7844290169cd6b561b424ecc92b159e9726b0ad5de3f478a8be",
|
||||
"algorithm": "sha512",
|
||||
"filename": "gcc.tar.xz",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
"size": 3008804,
|
||||
"visibility": "public",
|
||||
"digest": "ba6937f14f3d8b26dcb2d39490dee6b0a8afb60f672f5debb71d7b62c1ec52103201b4b1a3d258f945567de531384b36ddb2ce4aa73dc63d72305b11c146847c",
|
||||
"algorithm": "sha512",
|
||||
"unpack": true,
|
||||
"filename": "cctools.tar.gz"
|
||||
},
|
||||
{
|
||||
"size": 30823112,
|
||||
"visibility": "internal",
|
||||
"digest": "0c58e06a3ea8f4641c991a7406fc8733c574f0b4aa773bce0feaa5468d2b8440fa33cea056e16fad2b8a7ef4409ca7228113eb12adc87c3e115129d8a3b3b565",
|
||||
"algorithm": "sha512",
|
||||
"unpack": true,
|
||||
"filename": "MacOSX10.10.sdk.tar.xz"
|
||||
},
|
||||
{
|
||||
"version": "sccache rev b21198a7183a2fe226ff49348b1c0b51bae9f4f8",
|
||||
"algorithm": "sha512",
|
||||
"visibility": "public",
|
||||
"filename": "sccache2.tar.xz",
|
||||
"unpack": true,
|
||||
"digest": "b89c40dbf28c2bd54fadf017c15a8789f6e7611252a623cc3a1507e3dd6fc9e5a50d746e81776ba856e33fdc99b4a6413ba7c3ac0aed5f4835705da2b758ef22",
|
||||
"size": 1020700
|
||||
}
|
||||
]
|
|
@ -8,7 +8,7 @@
|
|||
* A "fields" array is used to communicate with FormAutofillContent. Each item
|
||||
* represents a single input field in the content page as well as its
|
||||
* @autocomplete properties. The schema is as below. Please refer to
|
||||
* FormAutofillContent.jsm for more details.
|
||||
* FormAutofillContent.js for more details.
|
||||
*
|
||||
* [
|
||||
* {
|
||||
|
|
|
@ -17,7 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FormAutofillParent",
|
|||
function startup() {
|
||||
// Besides this pref, we'll need dom.forms.autocomplete.experimental enabled
|
||||
// as well to make sure form autocomplete works correctly.
|
||||
if (!Services.prefs.getBoolPref("browser.formautofill.enabled")) {
|
||||
if (!Services.prefs.getBoolPref("browser.formautofill.experimental")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,45 @@
|
|||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr, manager: Cm} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
let {FormAutoCompleteResult} = Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm", {});
|
||||
Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FormLikeFactory",
|
||||
"resource://gre/modules/FormLikeFactory.jsm");
|
||||
|
||||
const formFillController = Cc["@mozilla.org/satchel/form-fill-controller;1"]
|
||||
.getService(Ci.nsIFormFillController);
|
||||
|
||||
const AUTOFILL_FIELDS_THRESHOLD = 3;
|
||||
|
||||
/**
|
||||
* Returns the autocomplete information of fields according to heuristics.
|
||||
*/
|
||||
let FormAutofillHeuristics = {
|
||||
VALID_FIELDS: [
|
||||
"organization",
|
||||
"street-address",
|
||||
"address-level2",
|
||||
"address-level1",
|
||||
"postal-code",
|
||||
"country",
|
||||
"tel",
|
||||
"email",
|
||||
],
|
||||
|
||||
getInfo(element) {
|
||||
if (!(element instanceof Ci.nsIDOMHTMLInputElement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let info = element.getAutocompleteInfo();
|
||||
if (!info || !info.fieldName ||
|
||||
!this.VALID_FIELDS.includes(info.fieldName)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return info;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles profile autofill for a DOM Form element.
|
||||
|
@ -55,14 +93,9 @@ FormAutofillHandler.prototype = {
|
|||
let autofillData = [];
|
||||
|
||||
for (let element of this.form.elements) {
|
||||
// Query the interface and exclude elements that cannot be autocompleted.
|
||||
if (!(element instanceof Ci.nsIDOMHTMLInputElement)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Exclude elements to which no autocomplete field has been assigned.
|
||||
let info = element.getAutocompleteInfo();
|
||||
if (!info.fieldName || ["on", "off"].includes(info.fieldName)) {
|
||||
let info = FormAutofillHeuristics.getInfo(element);
|
||||
if (!info) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -120,8 +153,9 @@ FormAutofillHandler.prototype = {
|
|||
continue;
|
||||
}
|
||||
|
||||
let info = fieldDetail.element.getAutocompleteInfo();
|
||||
if (field.section != info.section ||
|
||||
let info = FormAutofillHeuristics.getInfo(fieldDetail.element);
|
||||
if (!info ||
|
||||
field.section != info.section ||
|
||||
field.addressType != info.addressType ||
|
||||
field.contactType != info.contactType ||
|
||||
field.fieldName != info.fieldName) {
|
||||
|
@ -213,9 +247,6 @@ AutofillProfileAutoCompleteSearch.prototype = {
|
|||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AutofillProfileAutoCompleteSearch]);
|
||||
|
||||
// TODO: Remove this lint option once we apply ProfileAutocomplete while
|
||||
// content script initialization.
|
||||
/* eslint no-unused-vars: [2, {"vars": "local"}] */
|
||||
let ProfileAutocomplete = {
|
||||
_registered: false,
|
||||
_factory: null,
|
||||
|
@ -240,3 +271,63 @@ let ProfileAutocomplete = {
|
|||
this._registered = false;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles content's interactions.
|
||||
*
|
||||
* NOTE: Declares it by "var" to make it accessible in unit tests.
|
||||
*/
|
||||
var FormAutofillContent = {
|
||||
init() {
|
||||
ProfileAutocomplete.ensureRegistered();
|
||||
|
||||
addEventListener("DOMContentLoaded", this);
|
||||
},
|
||||
|
||||
handleEvent(evt) {
|
||||
if (!evt.isTrusted) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (evt.type) {
|
||||
case "DOMContentLoaded":
|
||||
let doc = evt.target;
|
||||
if (!(doc instanceof Ci.nsIDOMHTMLDocument)) {
|
||||
return;
|
||||
}
|
||||
this._identifyAutofillFields(doc);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_identifyAutofillFields(doc) {
|
||||
let forms = [];
|
||||
|
||||
// Collects root forms from inputs.
|
||||
for (let field of doc.getElementsByTagName("input")) {
|
||||
let formLike = FormLikeFactory.createFromField(field);
|
||||
if (!forms.some(form => form.rootElement === formLike.rootElement)) {
|
||||
forms.push(formLike);
|
||||
}
|
||||
}
|
||||
|
||||
// Collects the fields that can be autofilled from each form and marks them
|
||||
// as autofill fields if the amount is above the threshold.
|
||||
forms.forEach(form => {
|
||||
let formHandler = new FormAutofillHandler(form);
|
||||
formHandler.collectFormFields();
|
||||
if (formHandler.fieldDetails.length < AUTOFILL_FIELDS_THRESHOLD) {
|
||||
return;
|
||||
}
|
||||
|
||||
formHandler.fieldDetails.forEach(
|
||||
detail => this._markAsAutofillField(detail.element));
|
||||
});
|
||||
},
|
||||
|
||||
_markAsAutofillField(field) {
|
||||
formFillController.markAsAutofillField(field);
|
||||
},
|
||||
};
|
||||
|
||||
FormAutofillContent.init();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Provides infrastructure for automated formautofill components tests.
|
||||
*/
|
||||
|
||||
/* exported getTempFile */
|
||||
/* exported loadFormAutofillContent, getTempFile */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -38,7 +38,9 @@ Components.manager.addBootstrappedManifestLocation(extensionDir);
|
|||
let gFileCounter = Math.floor(Math.random() * 1000000);
|
||||
|
||||
function loadFormAutofillContent() {
|
||||
let facGlobal = {};
|
||||
let facGlobal = {
|
||||
addEventListener: function() {},
|
||||
};
|
||||
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader);
|
||||
loader.loadSubScriptWithOptions("chrome://formautofill/content/FormAutofillContent.js", {
|
||||
|
@ -82,13 +84,12 @@ function getTempFile(leafName) {
|
|||
}
|
||||
|
||||
add_task(function* test_common_initialize() {
|
||||
Services.prefs.setBoolPref("browser.formautofill.enabled", true);
|
||||
Services.prefs.setBoolPref("browser.formautofill.experimental", true);
|
||||
Services.prefs.setBoolPref("dom.forms.autocomplete.experimental", true);
|
||||
loadFormAutofillContent();
|
||||
|
||||
// Clean up after every test.
|
||||
do_register_cleanup(() => {
|
||||
Services.prefs.clearUserPref("browser.formautofill.enabled");
|
||||
Services.prefs.clearUserPref("browser.formautofill.experimental");
|
||||
Services.prefs.clearUserPref("dom.forms.autocomplete.experimental");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -15,8 +15,6 @@ const TESTCASES = [
|
|||
fieldDetails: [],
|
||||
profileData: [],
|
||||
expectedResult: {
|
||||
"given-name": "",
|
||||
"family-name": "",
|
||||
"street-addr": "",
|
||||
"city": "",
|
||||
"country": "",
|
||||
|
@ -52,8 +50,6 @@ const TESTCASES = [
|
|||
{"section": "", "addressType": "", "fieldName": "tel", "contactType": "", "index": 6, "value": "1234567"},
|
||||
],
|
||||
expectedResult: {
|
||||
"given-name": "foo",
|
||||
"family-name": "bar",
|
||||
"street-addr": "2 Harrison St",
|
||||
"city": "San Francisco",
|
||||
"country": "US",
|
||||
|
@ -89,8 +85,6 @@ const TESTCASES = [
|
|||
{"section": "", "addressType": "shipping", "fieldName": "tel", "contactType": "", "index": 6, "value": "1234567"},
|
||||
],
|
||||
expectedResult: {
|
||||
"given-name": "foo",
|
||||
"family-name": "bar",
|
||||
"street-addr": "2 Harrison St",
|
||||
"city": "San Francisco",
|
||||
"country": "US",
|
||||
|
@ -126,8 +120,6 @@ const TESTCASES = [
|
|||
{"section": "", "addressType": "shipping", "fieldName": "tel", "contactType": "", "index": 6},
|
||||
],
|
||||
expectedResult: {
|
||||
"given-name": "foo",
|
||||
"family-name": "bar",
|
||||
"street-addr": "2 Harrison St",
|
||||
"city": "San Francisco",
|
||||
"country": "US",
|
||||
|
@ -163,8 +155,6 @@ const TESTCASES = [
|
|||
{"section": "", "addressType": "shipping", "fieldName": "tel", "contactType": "", "index": 6, "value": "1234567"},
|
||||
],
|
||||
expectedResult: {
|
||||
"given-name": "foo",
|
||||
"family-name": "bar",
|
||||
"street-addr": "",
|
||||
"city": "",
|
||||
"country": "",
|
||||
|
|
|
@ -25,17 +25,13 @@ const TESTCASES = [
|
|||
<input id="email" autocomplete="email">
|
||||
<input id="tel" autocomplete="tel"></form>`,
|
||||
returnedFormat: [
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "given-name", "index": 0},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "family-name", "index": 1},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "street-address", "index": 2},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level2", "index": 3},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "country", "index": 4},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "email", "index": 5},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel", "index": 6},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "street-address", "index": 0},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level2", "index": 1},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "country", "index": 2},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "email", "index": 3},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "tel", "index": 4},
|
||||
],
|
||||
fieldDetails: [
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "given-name", "element": {}},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "family-name", "element": {}},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "street-address", "element": {}},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "address-level2", "element": {}},
|
||||
{"section": "", "addressType": "", "contactType": "", "fieldName": "country", "element": {}},
|
||||
|
@ -53,17 +49,13 @@ const TESTCASES = [
|
|||
<input id='email' autocomplete="shipping email">
|
||||
<input id="tel" autocomplete="shipping tel"></form>`,
|
||||
returnedFormat: [
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "given-name", "index": 0},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "family-name", "index": 1},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address", "index": 2},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2", "index": 3},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country", "index": 4},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "email", "index": 5},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "tel", "index": 6},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address", "index": 0},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2", "index": 1},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country", "index": 2},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "email", "index": 3},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "tel", "index": 4},
|
||||
],
|
||||
fieldDetails: [
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "given-name", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "family-name", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country", "element": {}},
|
||||
|
@ -81,17 +73,13 @@ const TESTCASES = [
|
|||
<input id='email' autocomplete="shipping email">
|
||||
<input id="tel" autocomplete="shipping tel"></form>`,
|
||||
returnedFormat: [
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "given-name", "index": 0},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "family-name", "index": 1},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address", "index": 2},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2", "index": 3},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country", "index": 4},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "email", "index": 5},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "tel", "index": 6},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address", "index": 0},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2", "index": 1},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country", "index": 2},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "email", "index": 3},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "tel", "index": 4},
|
||||
],
|
||||
fieldDetails: [
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "given-name", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "family-name", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2", "element": {}},
|
||||
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country", "element": {}},
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
"use strict";
|
||||
|
||||
let {FormAutofillContent} = loadFormAutofillContent();
|
||||
|
||||
const TESTCASES = [
|
||||
{
|
||||
description: "Form containing 5 fields with autocomplete attribute.",
|
||||
document: `<form>
|
||||
<input id="street-addr" autocomplete="street-address">
|
||||
<input id="city" autocomplete="address-level2">
|
||||
<input id="country" autocomplete="country">
|
||||
<input id="email" autocomplete="email">
|
||||
<input id="tel" autocomplete="tel">
|
||||
<input id="without-autocomplete-1">
|
||||
<input id="without-autocomplete-2">
|
||||
</form>`,
|
||||
expectedResult: [
|
||||
"street-addr",
|
||||
"city",
|
||||
"country",
|
||||
"email",
|
||||
"tel",
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "Form containing only 2 fields with autocomplete attribute.",
|
||||
document: `<form>
|
||||
<input id="street-addr" autocomplete="street-address">
|
||||
<input id="city" autocomplete="address-level2">
|
||||
<input id="without-autocomplete-1">
|
||||
<input id="without-autocomplete-2">
|
||||
</form>`,
|
||||
expectedResult: [],
|
||||
},
|
||||
{
|
||||
description: "Fields without form element.",
|
||||
document: `<input id="street-addr" autocomplete="street-address">
|
||||
<input id="city" autocomplete="address-level2">
|
||||
<input id="country" autocomplete="country">
|
||||
<input id="email" autocomplete="email">
|
||||
<input id="tel" autocomplete="tel">
|
||||
<input id="without-autocomplete-1">
|
||||
<input id="without-autocomplete-2">`,
|
||||
expectedResult: [
|
||||
"street-addr",
|
||||
"city",
|
||||
"country",
|
||||
"email",
|
||||
"tel",
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
let markedFieldId = [];
|
||||
FormAutofillContent._markAsAutofillField = function(field) {
|
||||
markedFieldId.push(field.id);
|
||||
};
|
||||
|
||||
TESTCASES.forEach(testcase => {
|
||||
add_task(function* () {
|
||||
do_print("Starting testcase: " + testcase.description);
|
||||
|
||||
markedFieldId = [];
|
||||
|
||||
let doc = MockDocument.createTestDocument(
|
||||
"http://localhost:8080/test/", testcase.document);
|
||||
FormAutofillContent._identifyAutofillFields(doc);
|
||||
|
||||
Assert.deepEqual(markedFieldId, testcase.expectedResult,
|
||||
"Check the fields were marked correctly.");
|
||||
});
|
||||
});
|
|
@ -8,3 +8,4 @@ support-files =
|
|||
[test_collectFormFields.js]
|
||||
[test_populateFieldValues.js]
|
||||
[test_profileStorage.js]
|
||||
[test_markAsAutofillField.js]
|
||||
|
|
|
@ -412,7 +412,6 @@
|
|||
@RESPATH@/components/amContentHandler.js
|
||||
@RESPATH@/components/amInstallTrigger.js
|
||||
@RESPATH@/components/amWebAPI.js
|
||||
@RESPATH@/components/amWebInstallListener.js
|
||||
@RESPATH@/components/nsBlocklistService.js
|
||||
@RESPATH@/components/nsBlocklistServiceContent.js
|
||||
#ifdef MOZ_UPDATER
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!ENTITY aboutAccounts.welcome "Welcome to &syncBrand.shortName.label;">
|
||||
<!ENTITY aboutAccounts.connected "Account connected">
|
||||
|
||||
<!ENTITY aboutAccountsConfig.description "Sign in to sync your tabs, bookmarks, passwords & more.">
|
||||
<!ENTITY aboutAccountsConfig.startButton.label "Get started">
|
||||
|
|
|
@ -26,5 +26,5 @@
|
|||
<!ENTITY tabCrashed.emailPlaceholder "Enter your email address here">
|
||||
<!ENTITY tabCrashed.emailMe "Email me when more information is available">
|
||||
<!ENTITY tabCrashed.reportSent "Crash report already submitted; thank you for helping make &brandShortName; better!">
|
||||
<!ENTITY tabCrashed.requestAutoSubmit "Request background tabs">
|
||||
<!ENTITY tabCrashed.requestAutoSubmit2 "Report background tabs">
|
||||
<!ENTITY tabCrashed.autoSubmit "Update preferences to automatically submit backlogged crash reports (and get fewer messages like this from us in the future)">
|
|
@ -25,7 +25,7 @@
|
|||
<!ENTITY syncMy.label "Sync My">
|
||||
<!ENTITY engine.bookmarks.label "Bookmarks">
|
||||
<!ENTITY engine.bookmarks.accesskey "m">
|
||||
<!ENTITY engine.tabs.label "Tabs">
|
||||
<!ENTITY engine.tabs.label2 "Open Tabs">
|
||||
<!ENTITY engine.tabs.accesskey "T">
|
||||
<!ENTITY engine.history.label "History">
|
||||
<!ENTITY engine.history.accesskey "r">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<!ENTITY engine.bookmarks.accesskey "m">
|
||||
<!ENTITY engine.history.label "History">
|
||||
<!ENTITY engine.history.accesskey "r">
|
||||
<!ENTITY engine.tabs.label "Tabs">
|
||||
<!ENTITY engine.tabs.label2 "Open Tabs">
|
||||
<!ENTITY engine.tabs.accesskey "T">
|
||||
<!ENTITY engine.passwords.label "Passwords">
|
||||
<!ENTITY engine.passwords.accesskey "P">
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<!ENTITY syncMy.label "Sync My">
|
||||
<!ENTITY engine.bookmarks.label "Bookmarks">
|
||||
<!ENTITY engine.bookmarks.accesskey "m">
|
||||
<!ENTITY engine.tabs.label "Tabs">
|
||||
<!ENTITY engine.tabs.label2 "Open Tabs">
|
||||
<!ENTITY engine.tabs.accesskey "T">
|
||||
<!ENTITY engine.history.label "History">
|
||||
<!ENTITY engine.history.accesskey "r">
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
*/
|
||||
|
||||
const { UnsubmittedCrashHandler } =
|
||||
Cu.import("resource:///modules/ContentCrashHandlers.jsm", this);
|
||||
Cu.import("resource:///modules/ContentCrashHandlers.jsm", {});
|
||||
const { FileUtils } =
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
const { makeFakeAppDir } =
|
||||
Cu.import("resource://testing-common/AppData.jsm", this);
|
||||
Cu.import("resource://testing-common/AppData.jsm", {});
|
||||
const { OS } =
|
||||
Cu.import("resource://gre/modules/osfile.jsm", this);
|
||||
Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
|
||||
const DAY = 24 * 60 * 60 * 1000; // milliseconds
|
||||
const SERVER_URL = "http://example.com/browser/toolkit/crashreporter/test/browser/crashreport.sjs";
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
margin-inline-end: 2em;
|
||||
}
|
||||
|
||||
#headers:-moz-locale-dir(rtl) {
|
||||
background-position-x: 100%;
|
||||
}
|
||||
|
||||
#tabsListHeading {
|
||||
font-size: 140%;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
margin-inline-end: 2em;
|
||||
}
|
||||
|
||||
#headers:-moz-locale-dir(rtl) {
|
||||
background-position-x: 100%;
|
||||
}
|
||||
|
||||
#tabsListHeading {
|
||||
font-size: 140%;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
margin-inline-end: 2em;
|
||||
}
|
||||
|
||||
#headers:-moz-locale-dir(rtl) {
|
||||
background-position-x: 100%;
|
||||
}
|
||||
|
||||
#tabsListHeading {
|
||||
font-size: 140%;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -39,8 +39,21 @@ build-clang.py accepts a JSON config format with the following fields:
|
|||
* gcc_dir: Path to the gcc toolchain installation, only required on Linux.
|
||||
* cc: Path to the bootsraping C Compiler.
|
||||
* cxx: Path to the bootsraping C++ Compiler.
|
||||
* ar: Path to the library archiver tool.
|
||||
* ranlib: Path to the ranlib tool.
|
||||
* ld: Path to the linker.
|
||||
* patches: Optional list of patches to apply per platform. Supported platforms: macosx64, linux32, linux64. The default is Release.
|
||||
* build_type: The type of build to make. Supported types: Release, Debug, RelWithDebInfo or MinSizeRel.
|
||||
* build_libcxx: Whether to build with libcxx. The default is false.
|
||||
* import_clang_tidy: Whether to import Mozilla checks into clang-tidy before building. The default is false.
|
||||
* osx_cross_compile: Whether to invoke CMake for OS X cross compile builds.
|
||||
* assertions: Whether to enable LLVM assertions. The default is false.
|
||||
|
||||
Environment Variables
|
||||
---------------------
|
||||
|
||||
The following environment variables are used for cross-compile builds targeting OS X on Linux.
|
||||
|
||||
* CROSS_CCTOOLS_PATH: Path to the cctools directory where the cross compiler toolchain is located.
|
||||
* CROSS_SYSROOT: Path to the OS X SDK directory for cross compile builds.
|
||||
* LIBCXX_INCLUDE_PATH: Path to the cross compiler libc++ headers.
|
||||
|
|
|
@ -190,8 +190,10 @@ def is_windows():
|
|||
return platform.system() == "Windows"
|
||||
|
||||
|
||||
def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
|
||||
build_type, assertions, python_path, gcc_dir):
|
||||
def build_one_stage(cc, cxx, ld, ar, ranlib,
|
||||
src_dir, stage_dir, build_libcxx,
|
||||
osx_cross_compile, build_type, assertions,
|
||||
python_path, gcc_dir):
|
||||
if not os.path.exists(stage_dir):
|
||||
os.mkdir(stage_dir)
|
||||
|
||||
|
@ -202,7 +204,7 @@ def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
|
|||
# arguments, so we need to re-run it. Make sure the cached copy of the
|
||||
# previous CMake run is cleared before running it again.
|
||||
if os.path.exists(build_dir + "/CMakeCache.txt"):
|
||||
os.path.remove(build_dir + "/CMakeCache.txt")
|
||||
os.remove(build_dir + "/CMakeCache.txt")
|
||||
|
||||
# cmake doesn't deal well with backslashes in paths.
|
||||
def slashify_path(path):
|
||||
|
@ -212,8 +214,12 @@ def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
|
|||
"-DCMAKE_C_COMPILER=%s" % slashify_path(cc[0]),
|
||||
"-DCMAKE_CXX_COMPILER=%s" % slashify_path(cxx[0]),
|
||||
"-DCMAKE_ASM_COMPILER=%s" % slashify_path(cc[0]),
|
||||
"-DCMAKE_LINKER=%s" % slashify_path(ld[0]),
|
||||
"-DCMAKE_AR=%s" % slashify_path(ar),
|
||||
"-DCMAKE_C_FLAGS=%s" % ' '.join(cc[1:]),
|
||||
"-DCMAKE_CXX_FLAGS=%s" % ' '.join(cxx[1:]),
|
||||
"-DCMAKE_EXE_LINKER_FLAGS=%s" % ' '.join(ld[1:]),
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS=%s" % ' '.join(ld[1:]),
|
||||
"-DCMAKE_BUILD_TYPE=%s" % build_type,
|
||||
"-DLLVM_TARGETS_TO_BUILD=X86;ARM",
|
||||
"-DLLVM_ENABLE_ASSERTIONS=%s" % ("ON" if assertions else "OFF"),
|
||||
|
@ -225,6 +231,22 @@ def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
|
|||
if is_windows():
|
||||
cmake_args.insert(-1, "-DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON")
|
||||
cmake_args.insert(-1, "-DLLVM_USE_CRT_RELEASE=MT")
|
||||
if ranlib is not None:
|
||||
cmake_args += ["-DCMAKE_RANLIB=%s" % slashify_path(ranlib)]
|
||||
if osx_cross_compile:
|
||||
cmake_args += ["-DCMAKE_SYSTEM_NAME=Darwin",
|
||||
"-DCMAKE_SYSTEM_VERSION=10.10",
|
||||
"-DLLVM_ENABLE_THREADS=OFF",
|
||||
"-DLIBCXXABI_LIBCXX_INCLUDES=%s" % slashify_path(os.getenv("LIBCXX_INCLUDE_PATH")),
|
||||
"-DCMAKE_OSX_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
|
||||
"-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")),
|
||||
"-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER",
|
||||
"-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY",
|
||||
"-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY",
|
||||
"-DCMAKE_MACOSX_RPATH=@executable_path",
|
||||
"-DCMAKE_OSX_ARCHITECTURES=x86_64",
|
||||
"-DDARWIN_osx_ARCHS=x86_64",
|
||||
"-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin10"]
|
||||
build_package(build_dir, cmake_args)
|
||||
|
||||
if is_linux():
|
||||
|
@ -234,19 +256,26 @@ def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
|
|||
if is_windows():
|
||||
install_import_library(build_dir, inst_dir)
|
||||
|
||||
def get_compiler(config, key):
|
||||
if key not in config:
|
||||
raise ValueError("Config file needs to set %s" % key)
|
||||
|
||||
f = config[key]
|
||||
if os.path.isabs(f):
|
||||
if not os.path.exists(f):
|
||||
raise ValueError("%s must point to an existing path" % key)
|
||||
return f
|
||||
# Return the absolute path of a build tool. We first look to see if the
|
||||
# variable is defined in the config file, and if so we make sure it's an
|
||||
# absolute path to an existing tool, otherwise we look for a program in
|
||||
# $PATH named "key".
|
||||
#
|
||||
# This expects the name of the key in the config file to match the name of
|
||||
# the tool in the default toolchain on the system (for example, "ld" on Unix
|
||||
# and "link" on Windows).
|
||||
def get_tool(config, key):
|
||||
f = None
|
||||
if key in config:
|
||||
f = config[key]
|
||||
if os.path.isabs(f):
|
||||
if not os.path.exists(f):
|
||||
raise ValueError("%s must point to an existing path" % key)
|
||||
return f
|
||||
|
||||
# Assume that we have the name of some program that should be on PATH.
|
||||
try:
|
||||
return which.which(f)
|
||||
return which.which(f) if f else which.which(key)
|
||||
except which.WhichError:
|
||||
raise ValueError("%s not found on PATH" % f)
|
||||
|
||||
|
@ -332,6 +361,13 @@ if __name__ == "__main__":
|
|||
import_clang_tidy = config["import_clang_tidy"]
|
||||
if import_clang_tidy not in (True, False):
|
||||
raise ValueError("Only boolean values are accepted for import_clang_tidy.")
|
||||
osx_cross_compile = False
|
||||
if "osx_cross_compile" in config:
|
||||
osx_cross_compile = config["osx_cross_compile"]
|
||||
if osx_cross_compile not in (True, False):
|
||||
raise ValueError("Only boolean values are accepted for osx_cross_compile.")
|
||||
if osx_cross_compile and not is_linux():
|
||||
raise ValueError("osx_cross_compile can only be used on Linux.")
|
||||
assertions = False
|
||||
if "assertions" in config:
|
||||
assertions = config["assertions"]
|
||||
|
@ -348,8 +384,11 @@ if __name__ == "__main__":
|
|||
raise ValueError("gcc_dir must point to an existing path")
|
||||
if is_linux() and gcc_dir is None:
|
||||
raise ValueError("Config file needs to set gcc_dir")
|
||||
cc = get_compiler(config, "cc")
|
||||
cxx = get_compiler(config, "cxx")
|
||||
cc = get_tool(config, "cc")
|
||||
cxx = get_tool(config, "cxx")
|
||||
ld = get_tool(config, "link" if is_windows() else "ld")
|
||||
ar = get_tool(config, "lib" if is_windows() else "ar")
|
||||
ranlib = None if is_windows() else get_tool(config, "ranlib")
|
||||
|
||||
if not os.path.exists(source_dir):
|
||||
os.makedirs(source_dir)
|
||||
|
@ -419,11 +458,13 @@ if __name__ == "__main__":
|
|||
extra_cxxflags = ["-stdlib=libc++"]
|
||||
extra_cflags2 = []
|
||||
extra_cxxflags2 = ["-stdlib=libc++"]
|
||||
extra_ldflags = []
|
||||
elif is_linux():
|
||||
extra_cflags = ["-static-libgcc"]
|
||||
extra_cxxflags = ["-static-libgcc", "-static-libstdc++"]
|
||||
extra_cflags2 = ["-fPIC"]
|
||||
extra_cxxflags2 = ["-fPIC", "-static-libstdc++"]
|
||||
extra_ldflags = []
|
||||
|
||||
if os.environ.has_key('LD_LIBRARY_PATH'):
|
||||
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH']);
|
||||
|
@ -437,11 +478,35 @@ if __name__ == "__main__":
|
|||
# Force things on.
|
||||
extra_cflags2 = []
|
||||
extra_cxxflags2 = ['-fms-compatibility-version=19.00.24213', '-Xclang', '-std=c++14']
|
||||
extra_ldflags = []
|
||||
|
||||
if osx_cross_compile:
|
||||
# undo the damage done in the is_linux() block above, and also simulate
|
||||
# the is_darwin() block above.
|
||||
extra_cflags = []
|
||||
extra_cxxflags = ["-stdlib=libc++"]
|
||||
extra_cxxflags2 = ["-stdlib=libc++"]
|
||||
|
||||
extra_flags = ["-target", "x86_64-apple-darwin10", "-mlinker-version=136",
|
||||
"-B", "%s/bin" % os.getenv("CROSS_CCTOOLS_PATH"),
|
||||
"-isysroot", os.getenv("CROSS_SYSROOT"),
|
||||
# technically the sysroot flag there should be enough to deduce this,
|
||||
# but clang needs some help to figure this out.
|
||||
"-I%s/usr/include" % os.getenv("CROSS_SYSROOT"),
|
||||
"-iframework", "%s/System/Library/Frameworks" % os.getenv("CROSS_SYSROOT")]
|
||||
extra_cflags += extra_flags
|
||||
extra_cxxflags += extra_flags
|
||||
extra_cflags2 += extra_flags
|
||||
extra_cxxflags2 += extra_flags
|
||||
extra_ldflags = ["-Wl,-syslibroot,%s" % os.getenv("CROSS_SYSROOT"),
|
||||
"-Wl,-dead_strip"]
|
||||
|
||||
build_one_stage(
|
||||
[cc] + extra_cflags,
|
||||
[cxx] + extra_cxxflags,
|
||||
llvm_source_dir, stage1_dir, build_libcxx,
|
||||
[ld] + extra_ldflags,
|
||||
ar, ranlib,
|
||||
llvm_source_dir, stage1_dir, build_libcxx, osx_cross_compile,
|
||||
build_type, assertions, python_path, gcc_dir)
|
||||
|
||||
if stages > 1:
|
||||
|
@ -453,7 +518,9 @@ if __name__ == "__main__":
|
|||
(cc_name, exe_ext)] + extra_cflags2,
|
||||
[stage1_inst_dir + "/bin/%s%s" %
|
||||
(cxx_name, exe_ext)] + extra_cxxflags2,
|
||||
llvm_source_dir, stage2_dir, build_libcxx,
|
||||
[ld] + extra_ldflags,
|
||||
ar, ranlib,
|
||||
llvm_source_dir, stage2_dir, build_libcxx, osx_cross_compile,
|
||||
build_type, assertions, python_path, gcc_dir)
|
||||
|
||||
if stages > 2:
|
||||
|
@ -464,7 +531,9 @@ if __name__ == "__main__":
|
|||
(cc_name, exe_ext)] + extra_cflags2,
|
||||
[stage2_inst_dir + "/bin/%s%s" %
|
||||
(cxx_name, exe_ext)] + extra_cxxflags2,
|
||||
llvm_source_dir, stage3_dir, build_libcxx,
|
||||
[ld] + extra_ldflags,
|
||||
ar, ranlib,
|
||||
llvm_source_dir, stage3_dir, build_libcxx, osx_cross_compile,
|
||||
build_type, assertions, python_path, gcc_dir)
|
||||
|
||||
if is_darwin() or is_windows():
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"llvm_revision": "290055",
|
||||
"stages": "1",
|
||||
"build_libcxx": true,
|
||||
"build_type": "Release",
|
||||
"assertions": false,
|
||||
"import_clang_tidy": true,
|
||||
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
|
||||
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
|
||||
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/trunk",
|
||||
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
|
||||
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
|
||||
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/trunk",
|
||||
"python_path": "/usr/bin/python2.7",
|
||||
"gcc_dir": "/home/worker/workspace/build/src/gcc",
|
||||
"cc": "/home/worker/workspace/build/src/gcc/bin/gcc",
|
||||
"cxx": "/home/worker/workspace/build/src/gcc/bin/g++"
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"llvm_revision": "290055",
|
||||
"stages": "1",
|
||||
"build_libcxx": true,
|
||||
"build_type": "Release",
|
||||
"assertions": false,
|
||||
"import_clang_tidy": true,
|
||||
"osx_cross_compile": true,
|
||||
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
|
||||
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
|
||||
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/trunk",
|
||||
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
|
||||
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
|
||||
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/trunk",
|
||||
"python_path": "/usr/bin/python2.7",
|
||||
"gcc_dir": "/home/worker/workspace/build/src/gcc",
|
||||
"cc": "/home/worker/workspace/build/src/clang/bin/clang",
|
||||
"cxx": "/home/worker/workspace/build/src/clang/bin/clang++",
|
||||
"ar": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin10-ar",
|
||||
"ranlib": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin10-ranlib",
|
||||
"ld": "/home/worker/workspace/build/src/clang/bin/clang"
|
||||
}
|
|
@ -37,12 +37,16 @@ label {
|
|||
label > span {
|
||||
display: inline-block;
|
||||
min-width: 150px;
|
||||
text-align: right;
|
||||
margin-right: 10px;
|
||||
text-align: end;
|
||||
margin-inline-end: 10px;
|
||||
}
|
||||
|
||||
#submit {
|
||||
float: right;
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
input {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
input:invalid {
|
||||
|
|
|
@ -6,9 +6,11 @@
|
|||
<!DOCTYPE html [
|
||||
<!ENTITY % connectionDTD SYSTEM "chrome://devtools/locale/connection-screen.dtd" >
|
||||
%connectionDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
]>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" dir="&locale.dir;"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<head>
|
||||
<title>&title;</title>
|
||||
|
|
|
@ -25,8 +25,6 @@ XPCOMUtils.defineConstant(window, "EVENTS", EVENTS);
|
|||
XPCOMUtils.defineConstant(window, "ACTIVITY_TYPE", ACTIVITY_TYPE);
|
||||
XPCOMUtils.defineConstant(window, "Editor", Editor);
|
||||
XPCOMUtils.defineConstant(window, "Prefs", Prefs);
|
||||
XPCOMUtils.defineLazyModuleGetter(window, "Chart",
|
||||
"resource://devtools/client/shared/widgets/Chart.jsm");
|
||||
|
||||
// Initialize the global Redux store
|
||||
window.gStore = configureStore();
|
||||
|
@ -711,6 +709,12 @@ NetworkEventsHandler.prototype = {
|
|||
* are available, or rejected if something goes wrong.
|
||||
*/
|
||||
getString: function (stringGrip) {
|
||||
// FIXME: this.webConsoleClient will be undefined in mochitest,
|
||||
// so we return string instantly to skip undefined error
|
||||
if (typeof stringGrip === "string") {
|
||||
return Promise.resolve(stringGrip);
|
||||
}
|
||||
|
||||
return this.webConsoleClient.getString(stringGrip);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -284,18 +284,17 @@
|
|||
|
||||
<html:div id="network-statistics-view">
|
||||
<html:div id="network-statistics-toolbar"
|
||||
class="devtools-toolbar">
|
||||
class="devtools-toolbar">
|
||||
<html:div xmlns="http://www.w3.org/1999/xhtml"
|
||||
id="react-statistics-back-hook"/>
|
||||
</html:div>
|
||||
<box id="network-statistics-charts"
|
||||
class="devtools-responsive-container"
|
||||
flex="1">
|
||||
<vbox id="primed-cache-chart" pack="center" flex="1"/>
|
||||
<splitter id="network-statistics-view-splitter"
|
||||
class="devtools-side-splitter"/>
|
||||
<vbox id="empty-cache-chart" pack="center" flex="1"/>
|
||||
</box>
|
||||
<html:div id="network-statistics-charts"
|
||||
class="devtools-responsive-container">
|
||||
<html:div id="primed-cache-chart"/>
|
||||
<html:div id="network-statistics-view-splitter"
|
||||
class="split-box devtools-side-splitter"/>
|
||||
<html:div id="empty-cache-chart"/>
|
||||
</html:div>
|
||||
</html:div>
|
||||
</deck>
|
||||
|
||||
|
|
|
@ -208,30 +208,25 @@ RequestsMenuView.prototype = {
|
|||
|
||||
if (responseContent && responseContent.content) {
|
||||
let request = getRequestById(this.store.getState(), action.id);
|
||||
let { text, encoding } = responseContent.content;
|
||||
if (request) {
|
||||
let { mimeType } = request;
|
||||
let { text, encoding } = responseContent.content;
|
||||
let response = yield gNetwork.getString(text);
|
||||
let payload = {};
|
||||
|
||||
if (mimeType.includes("image/")) {
|
||||
payload.responseContentDataUri = formDataURI(mimeType, encoding, response);
|
||||
}
|
||||
|
||||
if (mimeType.includes("text/")) {
|
||||
responseContent.content.text = response;
|
||||
payload.responseContent = responseContent;
|
||||
}
|
||||
|
||||
yield this.store.dispatch(Actions.updateRequest(action.id, payload, true));
|
||||
|
||||
// Fetch response data if the response is an image (to display thumbnail)
|
||||
if (mimeType.includes("image/")) {
|
||||
let responseBody = yield gNetwork.getString(text);
|
||||
const dataUri = formDataURI(mimeType, encoding, responseBody);
|
||||
yield this.store.dispatch(Actions.updateRequest(
|
||||
action.id,
|
||||
{ responseContentDataUri: dataUri },
|
||||
true
|
||||
));
|
||||
window.emit(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
|
||||
// Fetch response text only if the response is html, but not all text/*
|
||||
} else if (mimeType.includes("text/html") && typeof text !== "string") {
|
||||
let responseBody = yield gNetwork.getString(text);
|
||||
responseContent.content.text = responseBody;
|
||||
responseContent = Object.assign({}, responseContent);
|
||||
yield this.store.dispatch(Actions.updateRequest(
|
||||
action.id,
|
||||
{ responseContent },
|
||||
true
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -245,9 +240,12 @@ RequestsMenuView.prototype = {
|
|||
const headersSize = headers.reduce((acc, { name, value }) => {
|
||||
return acc + name.length + value.length + 2;
|
||||
}, 0);
|
||||
yield this.store.dispatch(Actions.updateRequest(action.id, {
|
||||
requestHeadersFromUploadStream: { headers, headersSize }
|
||||
}, true));
|
||||
let payload = {};
|
||||
requestPostData.postData.text = postData;
|
||||
payload.requestPostData = Object.assign({}, requestPostData);
|
||||
payload.requestHeadersFromUploadStream = { headers, headersSize };
|
||||
|
||||
yield this.store.dispatch(Actions.updateRequest(action.id, payload, true));
|
||||
}
|
||||
}),
|
||||
|
||||
|
|
|
@ -93,6 +93,17 @@ const getDisplayedRequestsSummary = createSelector(
|
|||
}
|
||||
);
|
||||
|
||||
const getSelectedRequest = createSelector(
|
||||
state => state.requests,
|
||||
requests => {
|
||||
if (!requests.selectedId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return requests.requests.find(r => r.id === requests.selectedId);
|
||||
}
|
||||
);
|
||||
|
||||
function getRequestById(state, id) {
|
||||
return state.requests.requests.find(r => r.id === id);
|
||||
}
|
||||
|
@ -101,19 +112,11 @@ function getDisplayedRequestById(state, id) {
|
|||
return getDisplayedRequests(state).find(r => r.id === id);
|
||||
}
|
||||
|
||||
function getSelectedRequest(state) {
|
||||
if (!state.requests.selectedId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return getRequestById(state, state.requests.selectedId);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSortedRequests,
|
||||
getDisplayedRequestById,
|
||||
getDisplayedRequests,
|
||||
getDisplayedRequestsSummary,
|
||||
getRequestById,
|
||||
getDisplayedRequestById,
|
||||
getSelectedRequest,
|
||||
getSortedRequests,
|
||||
};
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { PluralForm } = require("devtools/shared/plural-form");
|
||||
const { Filters } = require("./filter-predicates");
|
||||
const { L10N } = require("./l10n");
|
||||
|
@ -16,9 +15,7 @@ const { DOM } = require("devtools/client/shared/vendor/react");
|
|||
const { button } = DOM;
|
||||
const ReactDOM = require("devtools/client/shared/vendor/react-dom");
|
||||
const Actions = require("./actions/index");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Chart",
|
||||
"resource://devtools/client/shared/widgets/Chart.jsm");
|
||||
const { Chart } = require("devtools/client/shared/widgets/Chart");
|
||||
|
||||
const REQUEST_TIME_DECIMALS = 2;
|
||||
const CONTENT_SIZE_DECIMALS = 2;
|
||||
|
@ -38,6 +35,7 @@ StatisticsView.prototype = {
|
|||
*/
|
||||
initialize: function (store) {
|
||||
this.store = store;
|
||||
this.Chart = Chart;
|
||||
this._backButton = $("#react-statistics-back-hook");
|
||||
|
||||
let backStr = L10N.getStr("netmonitor.backButton");
|
||||
|
@ -149,7 +147,7 @@ StatisticsView.prototype = {
|
|||
* @param object
|
||||
* An object containing all or some the following properties:
|
||||
* - id: either "#primed-cache-chart" or "#empty-cache-chart"
|
||||
* - title/data/strings/totals/sorted: @see Chart.jsm for details
|
||||
* - title/data/strings/totals/sorted: @see Chart.js for details
|
||||
*/
|
||||
_createChart: function ({ id, title, data, strings, totals, sorted }) {
|
||||
let container = $(id);
|
||||
|
@ -160,7 +158,7 @@ StatisticsView.prototype = {
|
|||
}
|
||||
|
||||
// Create a new chart.
|
||||
let chart = Chart.PieTable(document, {
|
||||
let chart = this.Chart.PieTable(document, {
|
||||
diameter: NETWORK_ANALYSIS_PIE_CHART_DIAMETER,
|
||||
title: L10N.getStr(title),
|
||||
data: data,
|
||||
|
@ -180,7 +178,7 @@ StatisticsView.prototype = {
|
|||
|
||||
/**
|
||||
* Sanitizes the data source used for creating charts, to follow the
|
||||
* data format spec defined in Chart.jsm.
|
||||
* data format spec defined in Chart.js.
|
||||
*
|
||||
* @param array items
|
||||
* A collection of request items used as the data source for the chart.
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче