Skip to content

Commit

Permalink
Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE
Browse files Browse the repository at this point in the history
  • Loading branch information
SV-ACiure committed Apr 11, 2018
2 parents 81e559a + 3cfd837 commit 6c32299
Show file tree
Hide file tree
Showing 331 changed files with 11,811 additions and 9,377 deletions.
304 changes: 152 additions & 152 deletions accessible/base/ARIAMap.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions accessible/base/ARIAMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct nsRoleMapEntry
* Return true if matches to the given ARIA role.
*/
bool Is(nsAtom* aARIARole) const
{ return roleAtom == aARIARole; }
{ return *roleAtom == aARIARole; }

/**
* Return true if ARIA role has the given accessible type.
Expand All @@ -154,10 +154,10 @@ struct nsRoleMapEntry
* Return ARIA role.
*/
const nsDependentAtomString ARIARoleString() const
{ return nsDependentAtomString(roleAtom); }
{ return nsDependentAtomString(*roleAtom); }

// ARIA role: string representation such as "button"
nsStaticAtom* const roleAtom;
nsStaticAtom** roleAtom;

// Role mapping rule: maps to enum Role
mozilla::a11y::role role;
Expand Down
16 changes: 8 additions & 8 deletions accessible/base/ARIAStateMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct EnumTypeData

// States if the attribute value is matched to the enum value. Used as
// Element::AttrValuesArray, last item must be nullptr.
nsStaticAtom* const mValues[4];
nsStaticAtom* const* const mValues[4];

// States applied if corresponding enum values are matched.
const uint64_t mStates[3];
Expand Down Expand Up @@ -89,9 +89,9 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
{
static const EnumTypeData data = {
nsGkAtoms::aria_autocomplete,
{ nsGkAtoms::inlinevalue,
nsGkAtoms::list_,
nsGkAtoms::both, nullptr },
{ &nsGkAtoms::inlinevalue,
&nsGkAtoms::list_,
&nsGkAtoms::both, nullptr },
{ states::SUPPORTS_AUTOCOMPLETION,
states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION,
states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION }, 0
Expand All @@ -105,8 +105,8 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
{
static const EnumTypeData data = {
nsGkAtoms::aria_busy,
{ nsGkAtoms::_true,
nsGkAtoms::error, nullptr },
{ &nsGkAtoms::_true,
&nsGkAtoms::error, nullptr },
{ states::BUSY,
states::INVALID }, 0
};
Expand Down Expand Up @@ -229,8 +229,8 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
{
static const EnumTypeData data = {
nsGkAtoms::aria_orientation,
{ nsGkAtoms::horizontal,
nsGkAtoms::vertical, nullptr },
{ &nsGkAtoms::horizontal,
&nsGkAtoms::vertical, nullptr },
{ states::HORIZONTAL,
states::VERTICAL },
states::HORIZONTAL | states::VERTICAL
Expand Down
2 changes: 1 addition & 1 deletion accessible/base/TextAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ TextAttrsMgr::InvalidTextAttr::
do {
if (nsAccUtils::HasDefinedARIAToken(elm, nsGkAtoms::aria_invalid)) {
static Element::AttrValuesArray tokens[] =
{ nsGkAtoms::_false, nsGkAtoms::grammar, nsGkAtoms::spelling,
{ &nsGkAtoms::_false, &nsGkAtoms::grammar, &nsGkAtoms::spelling,
nullptr };

int32_t idx = elm->AsElement()->FindAttrValueIn(kNameSpaceID_None,
Expand Down
2 changes: 1 addition & 1 deletion accessible/base/XULMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ XULMAP(
panel,
[](nsIContent* aContent, Accessible* aContext) -> Accessible* {
static const Element::AttrValuesArray sIgnoreTypeVals[] =
{ nsGkAtoms::autocomplete_richlistbox, nsGkAtoms::autocomplete, nullptr };
{ &nsGkAtoms::autocomplete_richlistbox, &nsGkAtoms::autocomplete, nullptr };

if (!aContent->IsElement() ||
aContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
Expand Down
7 changes: 4 additions & 3 deletions accessible/base/nsAccUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,20 @@ nsAccUtils::HasDefinedARIAToken(nsIContent *aContent, nsAtom *aAtom)
return true;
}

nsStaticAtom*
nsAtom*
nsAccUtils::GetARIAToken(dom::Element* aElement, nsAtom* aAttr)
{
if (!HasDefinedARIAToken(aElement, aAttr))
return nsGkAtoms::_empty;

static Element::AttrValuesArray tokens[] =
{ nsGkAtoms::_false, nsGkAtoms::_true, nsGkAtoms::mixed, nullptr};
{ &nsGkAtoms::_false, &nsGkAtoms::_true,
&nsGkAtoms::mixed, nullptr};

int32_t idx = aElement->FindAttrValueIn(kNameSpaceID_None,
aAttr, tokens, eCaseMatters);
if (idx >= 0)
return tokens[idx];
return *(tokens[idx]);

return nullptr;
}
Expand Down
3 changes: 1 addition & 2 deletions accessible/base/nsAccUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ class nsAccUtils
/**
* Return atomic value of ARIA attribute of boolean or NMTOKEN type.
*/
static nsStaticAtom* GetARIAToken(mozilla::dom::Element* aElement,
nsAtom* aAttr);
static nsAtom* GetARIAToken(mozilla::dom::Element* aElement, nsAtom* aAttr);

/**
* Return document accessible for the given DOM node.
Expand Down
26 changes: 13 additions & 13 deletions accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ static int32_t sPlatformDisabledState = 0;
// Markup maps array.

#define Attr(name, value) \
{ nsGkAtoms::name, nsGkAtoms::value }
{ &nsGkAtoms::name, &nsGkAtoms::value }

#define AttrFromDOM(name, DOMAttrName) \
{ nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName }
{ &nsGkAtoms::name, nullptr, &nsGkAtoms::DOMAttrName }

#define AttrFromDOMIf(name, DOMAttrName, DOMAttrValue) \
{ nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName, nsGkAtoms::DOMAttrValue }
{ &nsGkAtoms::name, nullptr, &nsGkAtoms::DOMAttrName, &nsGkAtoms::DOMAttrValue }

#define MARKUPMAP(atom, new_func, r, ... ) \
{ nsGkAtoms::atom, new_func, static_cast<a11y::role>(r), { __VA_ARGS__ } },
{ &nsGkAtoms::atom, new_func, static_cast<a11y::role>(r), { __VA_ARGS__ } },

static const HTMLMarkupMapInfo sHTMLMarkupMapList[] = {
#include "MarkupMap.h"
Expand All @@ -323,7 +323,7 @@ static const HTMLMarkupMapInfo sHTMLMarkupMapList[] = {

#ifdef MOZ_XUL
#define XULMAP(atom, ...) \
{ nsGkAtoms::atom, __VA_ARGS__ },
{ &nsGkAtoms::atom, __VA_ARGS__ },

#define XULMAP_TYPE(atom, new_type) \
XULMAP( \
Expand Down Expand Up @@ -1349,11 +1349,11 @@ nsAccessibilityService::Init()
eventListenerService->AddListenerChangeListener(this);

for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++)
mHTMLMarkupMap.Put(sHTMLMarkupMapList[i].tag, &sHTMLMarkupMapList[i]);
mHTMLMarkupMap.Put(*sHTMLMarkupMapList[i].tag, &sHTMLMarkupMapList[i]);

#ifdef MOZ_XUL
for (uint32_t i = 0; i < ArrayLength(sXULMarkupMapList); i++)
mXULMarkupMap.Put(sXULMarkupMapList[i].tag, &sXULMarkupMapList[i]);
mXULMarkupMap.Put(*sXULMarkupMapList[i].tag, &sXULMarkupMapList[i]);
#endif

#ifdef A11Y_LOG
Expand Down Expand Up @@ -1615,27 +1615,27 @@ nsAccessibilityService::MarkupAttributes(const nsIContent* aContent,
if (info->DOMAttrValue) {
if (aContent->IsElement() &&
aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
info->DOMAttrName,
info->DOMAttrValue,
*info->DOMAttrName,
*info->DOMAttrValue,
eCaseMatters)) {
nsAccUtils::SetAccAttr(aAttributes, info->name, info->DOMAttrValue);
nsAccUtils::SetAccAttr(aAttributes, *info->name, *info->DOMAttrValue);
}
continue;
}

nsAutoString value;

if (aContent->IsElement()) {
aContent->AsElement()->GetAttr(kNameSpaceID_None, info->DOMAttrName, value);
aContent->AsElement()->GetAttr(kNameSpaceID_None, *info->DOMAttrName, value);
}

if (!value.IsEmpty())
nsAccUtils::SetAccAttr(aAttributes, info->name, value);
nsAccUtils::SetAccAttr(aAttributes, *info->name, value);

continue;
}

nsAccUtils::SetAccAttr(aAttributes, info->name, info->value);
nsAccUtils::SetAccAttr(aAttributes, *info->name, *info->value);
}
}

Expand Down
13 changes: 6 additions & 7 deletions accessible/base/nsAccessibilityService.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,24 @@ xpcAccessibleApplication* XPCApplicationAcc();

typedef Accessible* (New_Accessible)(nsIContent* aContent, Accessible* aContext);

// These fields are not `nsStaticAtom* const` because MSVC doesn't like it.
struct MarkupAttrInfo {
nsStaticAtom* name;
nsStaticAtom* value;
nsStaticAtom** name;
nsStaticAtom** value;

nsStaticAtom* DOMAttrName;
nsStaticAtom* DOMAttrValue;
nsStaticAtom** DOMAttrName;
nsStaticAtom** DOMAttrValue;
};

struct HTMLMarkupMapInfo {
const nsStaticAtom* const tag;
nsStaticAtom** tag;
New_Accessible* new_func;
a11y::role role;
MarkupAttrInfo attrs[4];
};

#ifdef MOZ_XUL
struct XULMarkupMapInfo {
const nsStaticAtom* const tag;
nsStaticAtom** tag;
New_Accessible* new_func;
};
#endif
Expand Down
5 changes: 2 additions & 3 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,9 +1491,8 @@ nsAtom*
Accessible::LandmarkRole() const
{
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
return roleMapEntry && roleMapEntry->IsOfType(eLandmark)
? roleMapEntry->roleAtom
: nullptr;
return roleMapEntry && roleMapEntry->IsOfType(eLandmark) ?
*(roleMapEntry->roleAtom) : nullptr;
}

role
Expand Down
28 changes: 14 additions & 14 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// Static member initialization

static nsStaticAtom* const kRelationAttrs[] =
{
nsGkAtoms::aria_labelledby,
nsGkAtoms::aria_describedby,
nsGkAtoms::aria_details,
nsGkAtoms::aria_owns,
nsGkAtoms::aria_controls,
nsGkAtoms::aria_flowto,
nsGkAtoms::aria_errormessage,
nsGkAtoms::_for,
nsGkAtoms::control
static nsStaticAtom** kRelationAttrs[] =
{
&nsGkAtoms::aria_labelledby,
&nsGkAtoms::aria_describedby,
&nsGkAtoms::aria_details,
&nsGkAtoms::aria_owns,
&nsGkAtoms::aria_controls,
&nsGkAtoms::aria_flowto,
&nsGkAtoms::aria_errormessage,
&nsGkAtoms::_for,
&nsGkAtoms::control
};

static const uint32_t kRelationAttrsLen = ArrayLength(kRelationAttrs);
Expand Down Expand Up @@ -1557,7 +1557,7 @@ DocAccessible::AddDependentIDsFor(Accessible* aRelProvider, nsAtom* aRelAttr)
return;

for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
nsStaticAtom* relAttr = kRelationAttrs[idx];
nsAtom* relAttr = *kRelationAttrs[idx];
if (aRelAttr && aRelAttr != relAttr)
continue;

Expand Down Expand Up @@ -1629,8 +1629,8 @@ DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
return;

for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
nsStaticAtom* relAttr = kRelationAttrs[idx];
if (aRelAttr && aRelAttr != kRelationAttrs[idx])
nsAtom* relAttr = *kRelationAttrs[idx];
if (aRelAttr && aRelAttr != *kRelationAttrs[idx])
continue;

IDRefsIterator iter(this, relProviderElm, relAttr);
Expand Down
4 changes: 2 additions & 2 deletions accessible/html/HTMLTableAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ HTMLTableHeaderCellAccessible::NativeRole()
{
// Check value of @scope attribute.
static Element::AttrValuesArray scopeValues[] =
{ nsGkAtoms::col, nsGkAtoms::colgroup,
nsGkAtoms::row, nsGkAtoms::rowgroup, nullptr };
{ &nsGkAtoms::col, &nsGkAtoms::colgroup,
&nsGkAtoms::row, &nsGkAtoms::rowgroup, nullptr };
int32_t valueIdx =
mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
scopeValues, eCaseMatters);
Expand Down
2 changes: 1 addition & 1 deletion accessible/ipc/ProxyAccessibleShared.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool IsSearchbox() const;

nsAtom* LandmarkRole() const;

nsStaticAtom* ARIARoleAtom() const;
nsAtom* ARIARoleAtom() const;

int32_t GetLevelInternal();
void ScrollTo(uint32_t aScrollType);
Expand Down
2 changes: 1 addition & 1 deletion accessible/ipc/other/DocAccessibleChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ DocAccessibleChild::RecvARIARoleAtom(const uint64_t& aID, nsString* aRole)
}

if (const nsRoleMapEntry* roleMap = acc->ARIARoleMap()) {
if (nsStaticAtom* roleAtom = roleMap->roleAtom) {
if (nsAtom* roleAtom = *(roleMap->roleAtom)) {
roleAtom->ToString(*aRole);
}
}
Expand Down
2 changes: 1 addition & 1 deletion accessible/ipc/other/ProxyAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ ProxyAccessible::LandmarkRole() const
return NS_GetStaticAtom(landmark);
}

nsStaticAtom*
nsAtom*
ProxyAccessible::ARIARoleAtom() const
{
nsString role;
Expand Down
4 changes: 2 additions & 2 deletions accessible/mac/mozAccessible.mm
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,10 @@ - (NSString*)subrole
return @"AXLandmarkRegion";

// Now, deal with widget roles
nsStaticAtom* roleAtom = nullptr;
nsAtom* roleAtom = nullptr;
if (accWrap && accWrap->HasARIARole()) {
const nsRoleMapEntry* roleMap = accWrap->ARIARoleMap();
roleAtom = roleMap->roleAtom;
roleAtom = *roleMap->roleAtom;
}
if (proxy)
roleAtom = proxy->ARIARoleAtom();
Expand Down
2 changes: 1 addition & 1 deletion accessible/xul/XULFormControlAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ bool
XULButtonAccessible::ContainsMenu() const
{
static Element::AttrValuesArray strings[] =
{nsGkAtoms::menu, nsGkAtoms::menuButton, nullptr};
{&nsGkAtoms::menu, &nsGkAtoms::menuButton, nullptr};

return mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
nsGkAtoms::type,
Expand Down
2 changes: 1 addition & 1 deletion accessible/xul/XULMenuAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ XULMenuitemAccessible::NativeState()

// Checkable/checked?
static Element::AttrValuesArray strings[] =
{ nsGkAtoms::radio, nsGkAtoms::checkbox, nullptr };
{ &nsGkAtoms::radio, &nsGkAtoms::checkbox, nullptr };

if (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
strings, eCaseMatters) >= 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ skip-if = (os == 'win' && !debug) # bug 1352668
[browser_ext_commands_getAll.js]
[browser_ext_commands_onCommand.js]
[browser_ext_commands_update.js]
[browser_ext_connect_and_move_tabs.js]
[browser_ext_contentscript_connect.js]
[browser_ext_contextMenus.js]
[browser_ext_contextMenus_checkboxes.js]
Expand Down
Loading

0 comments on commit 6c32299

Please sign in to comment.