From 36c48819d12138a7d3d9bc5bc0b033a81522057e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 3 Apr 2018 13:21:06 +1000 Subject: [PATCH] Bug 1451169 - Use `nsStaticAtom*` instead of `nsStaticAtom**` in Element.h. r=baku --HG-- extra : rebase_source : db09f7ab93a1c41ace03a645623f78a27ecfff8c --- accessible/base/ARIAStateMap.cpp | 16 ++-- accessible/base/TextAttrs.cpp | 2 +- accessible/base/XULMap.h | 2 +- accessible/base/nsAccUtils.cpp | 7 +- accessible/base/nsAccUtils.h | 3 +- accessible/html/HTMLTableAccessible.cpp | 4 +- accessible/xul/XULMenuAccessible.cpp | 2 +- dom/base/Element.cpp | 18 ++-- dom/base/Element.h | 6 +- dom/base/FragmentOrElement.cpp | 10 +- dom/base/nsContentUtils.cpp | 2 +- dom/events/EventStateManager.cpp | 2 +- dom/html/HTMLBRElement.cpp | 2 +- dom/html/HTMLBodyElement.cpp | 20 ++-- dom/html/HTMLFontElement.cpp | 6 +- dom/html/HTMLHRElement.cpp | 10 +- dom/html/HTMLIFrameElement.cpp | 6 +- dom/html/HTMLInputElement.cpp | 2 +- dom/html/HTMLLIElement.cpp | 2 +- dom/html/HTMLLinkElement.cpp | 2 +- dom/html/HTMLPreElement.cpp | 2 +- dom/html/HTMLSharedElement.cpp | 4 +- dom/html/HTMLSharedListElement.cpp | 2 +- dom/html/HTMLTableCaptionElement.cpp | 2 +- dom/html/HTMLTableCellElement.cpp | 18 ++-- dom/html/HTMLTableColElement.cpp | 8 +- dom/html/HTMLTableElement.cpp | 18 ++-- dom/html/HTMLTableRowElement.cpp | 6 +- dom/html/HTMLTableSectionElement.cpp | 6 +- dom/html/HTMLTextAreaElement.cpp | 2 +- dom/html/HTMLVideoElement.cpp | 4 +- dom/html/nsGenericHTMLElement.cpp | 28 +++--- dom/html/nsGenericHTMLElement.h | 2 +- dom/html/nsTextEditorState.cpp | 2 +- dom/mathml/nsMathMLElement.cpp | 38 ++++---- dom/svg/SVGAElement.cpp | 8 +- dom/svg/nsSVGElement.cpp | 112 +++++++++++------------ dom/xbl/nsXBLPrototypeBinding.cpp | 12 +-- dom/xul/XULDocument.cpp | 2 +- layout/base/PositionedEventTargeting.cpp | 2 +- layout/generic/nsImageMap.cpp | 8 +- layout/xul/nsBoxFrame.cpp | 18 ++-- layout/xul/nsImageBoxFrame.cpp | 2 +- layout/xul/nsLeafBoxFrame.cpp | 2 +- layout/xul/nsMenuFrame.cpp | 2 +- layout/xul/nsMenuPopupFrame.cpp | 2 +- layout/xul/nsResizerFrame.cpp | 8 +- layout/xul/nsScrollbarButtonFrame.cpp | 4 +- layout/xul/nsSplitterFrame.cpp | 10 +- layout/xul/nsTextBoxFrame.cpp | 4 +- layout/xul/nsXULPopupManager.cpp | 2 +- layout/xul/tree/nsTreeColumns.cpp | 5 +- layout/xul/tree/nsTreeContentView.cpp | 2 +- layout/xul/tree/nsTreeSelection.cpp | 2 +- widget/cocoa/nsMenuX.mm | 2 +- widget/nsNativeTheme.cpp | 6 +- 56 files changed, 241 insertions(+), 240 deletions(-) diff --git a/accessible/base/ARIAStateMap.cpp b/accessible/base/ARIAStateMap.cpp index 7956a979b01b..f7a187ecbad7 100644 --- a/accessible/base/ARIAStateMap.cpp +++ b/accessible/base/ARIAStateMap.cpp @@ -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* const mValues[4]; + nsStaticAtom* const mValues[4]; // States applied if corresponding enum values are matched. const uint64_t mStates[3]; @@ -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 @@ -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 }; @@ -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 diff --git a/accessible/base/TextAttrs.cpp b/accessible/base/TextAttrs.cpp index ecad43a86544..279e85b46d3f 100644 --- a/accessible/base/TextAttrs.cpp +++ b/accessible/base/TextAttrs.cpp @@ -303,7 +303,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, diff --git a/accessible/base/XULMap.h b/accessible/base/XULMap.h index fbf0b552a904..c3f05523fa75 100644 --- a/accessible/base/XULMap.h +++ b/accessible/base/XULMap.h @@ -90,7 +90,7 @@ XULMAP( panel, [](Element* aElement, Accessible* aContext) -> Accessible* { static const Element::AttrValuesArray sIgnoreTypeVals[] = - { &nsGkAtoms::autocomplete_richlistbox, &nsGkAtoms::autocomplete, nullptr }; + { nsGkAtoms::autocomplete_richlistbox, nsGkAtoms::autocomplete, nullptr }; if (aElement->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, sIgnoreTypeVals, eIgnoreCase) >= 0) { diff --git a/accessible/base/nsAccUtils.cpp b/accessible/base/nsAccUtils.cpp index 78fd8bd7ee7f..2bb925f47697 100644 --- a/accessible/base/nsAccUtils.cpp +++ b/accessible/base/nsAccUtils.cpp @@ -208,20 +208,19 @@ nsAccUtils::HasDefinedARIAToken(nsIContent *aContent, nsAtom *aAtom) return true; } -nsAtom* +nsStaticAtom* 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; } diff --git a/accessible/base/nsAccUtils.h b/accessible/base/nsAccUtils.h index 59df8d9b345e..5e54a8daa8f0 100644 --- a/accessible/base/nsAccUtils.h +++ b/accessible/base/nsAccUtils.h @@ -101,7 +101,8 @@ public: /** * Return atomic value of ARIA attribute of boolean or NMTOKEN type. */ - static nsAtom* GetARIAToken(mozilla::dom::Element* aElement, nsAtom* aAttr); + static nsStaticAtom* GetARIAToken(mozilla::dom::Element* aElement, + nsAtom* aAttr); /** * Return document accessible for the given DOM node. diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp index fb7d3c93cfed..ea8b5bfd1645 100644 --- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -307,8 +307,8 @@ HTMLTableHeaderCellAccessible::NativeRole() const { // 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); diff --git a/accessible/xul/XULMenuAccessible.cpp b/accessible/xul/XULMenuAccessible.cpp index 3bf6d2a3aa21..bffeb5e23791 100644 --- a/accessible/xul/XULMenuAccessible.cpp +++ b/accessible/xul/XULMenuAccessible.cpp @@ -58,7 +58,7 @@ XULMenuitemAccessible::NativeState() const // 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) { diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 0d739e0e19ff..4b0dab502059 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -2228,7 +2228,7 @@ Element::FindAttributeDependence(const nsAtom* aAttribute, for (uint32_t mapindex = 0; mapindex < aMapCount; ++mapindex) { for (const MappedAttributeEntry* map = aMaps[mapindex]; map->attribute; ++map) { - if (aAttribute == *map->attribute) { + if (aAttribute == map->attribute) { return true; } } @@ -2957,7 +2957,7 @@ Element::FindAttrValueIn(int32_t aNameSpaceID, const nsAttrValue* val = mAttrs.GetAttr(aName, aNameSpaceID); if (val) { for (int32_t i = 0; aValues[i]; ++i) { - if (val->Equals(*aValues[i], aCaseSensitive)) { + if (val->Equals(aValues[i], aCaseSensitive)) { return i; } } @@ -3469,16 +3469,16 @@ nsDOMTokenListPropertyDestructor(void *aObject, nsAtom *aProperty, NS_RELEASE(list); } -static nsStaticAtom** sPropertiesToTraverseAndUnlink[] = +static nsStaticAtom* const sPropertiesToTraverseAndUnlink[] = { - &nsGkAtoms::sandbox, - &nsGkAtoms::sizes, - &nsGkAtoms::dirAutoSetBy, + nsGkAtoms::sandbox, + nsGkAtoms::sizes, + nsGkAtoms::dirAutoSetBy, nullptr }; // static -nsStaticAtom*** +nsStaticAtom* const* Element::HTMLSVGPropertiesToTraverseAndUnlink() { return sPropertiesToTraverseAndUnlink; @@ -3489,10 +3489,10 @@ Element::GetTokenList(nsAtom* aAtom, const DOMTokenListSupportedTokenArray aSupportedTokens) { #ifdef DEBUG - nsStaticAtom*** props = HTMLSVGPropertiesToTraverseAndUnlink(); + const nsStaticAtom* const* props = HTMLSVGPropertiesToTraverseAndUnlink(); bool found = false; for (uint32_t i = 0; props[i]; ++i) { - if (*props[i] == aAtom) { + if (props[i] == aAtom) { found = true; break; } diff --git a/dom/base/Element.h b/dom/base/Element.h index fc4ed5ead837..e52b297d2d35 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -834,7 +834,7 @@ public: * @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index * indicating the first value of aValues that matched */ - typedef nsStaticAtom* const* const AttrValuesArray; + typedef nsStaticAtom* const AttrValuesArray; int32_t FindAttrValueIn(int32_t aNameSpaceID, nsAtom* aName, AttrValuesArray* aValues, @@ -984,7 +984,7 @@ public: * Attribute Mapping Helpers */ struct MappedAttributeEntry { - nsStaticAtom** attribute; + const nsStaticAtom* const attribute; }; /** @@ -1001,7 +1001,7 @@ public: return FindAttributeDependence(aAttribute, aMaps, N); } - static nsStaticAtom*** HTMLSVGPropertiesToTraverseAndUnlink(); + static nsStaticAtom* const* HTMLSVGPropertiesToTraverseAndUnlink(); private: void DescribeAttribute(uint32_t index, nsAString& aOutDescription) const; diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index dbcdce2da53e..44bdfeebd54a 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1483,9 +1483,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement) } if (tmp->IsHTMLElement() || tmp->IsSVGElement()) { - nsStaticAtom*** props = Element::HTMLSVGPropertiesToTraverseAndUnlink(); + nsStaticAtom* const* props = + Element::HTMLSVGPropertiesToTraverseAndUnlink(); for (uint32_t i = 0; props[i]; ++i) { - tmp->DeleteProperty(*props[i]); + tmp->DeleteProperty(props[i]); } if (tmp->MayHaveAnimations()) { nsAtom** effectProps = EffectSet::GetEffectSetPropertyAtoms(); @@ -2039,10 +2040,11 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement) } } if (tmp->IsHTMLElement() || tmp->IsSVGElement()) { - nsStaticAtom*** props = Element::HTMLSVGPropertiesToTraverseAndUnlink(); + nsStaticAtom* const* props = + Element::HTMLSVGPropertiesToTraverseAndUnlink(); for (uint32_t i = 0; props[i]; ++i) { nsISupports* property = - static_cast(tmp->GetProperty(*props[i])); + static_cast(tmp->GetProperty(props[i])); cb.NoteXPCOMChild(property); } if (tmp->MayHaveAnimations()) { diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index dc6fa7bc5e0a..ea55a251bbd5 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -4645,7 +4645,7 @@ nsContentUtils::HasNonEmptyAttr(const nsIContent* aContent, int32_t aNameSpaceID, nsAtom* aName) { - static Element::AttrValuesArray strings[] = {&nsGkAtoms::_empty, nullptr}; + static Element::AttrValuesArray strings[] = {nsGkAtoms::_empty, nullptr}; return aContent->IsElement() && aContent->AsElement()->FindAttrValueIn(aNameSpaceID, aName, strings, eCaseMatters) == Element::ATTR_VALUE_NO_MATCH; diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index d164f4399ba4..1147bb7c9c24 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3012,7 +3012,7 @@ NodeAllowsClickThrough(nsINode* aNode) if (aNode->IsXULElement()) { mozilla::dom::Element* element = aNode->AsElement(); static Element::AttrValuesArray strings[] = - {&nsGkAtoms::always, &nsGkAtoms::never, nullptr}; + {nsGkAtoms::always, nsGkAtoms::never, nullptr}; switch (element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::clickthrough, strings, eCaseMatters)) { case 0: diff --git a/dom/html/HTMLBRElement.cpp b/dom/html/HTMLBRElement.cpp index 6654eaa3cf56..fd2e7406b86c 100644 --- a/dom/html/HTMLBRElement.cpp +++ b/dom/html/HTMLBRElement.cpp @@ -67,7 +67,7 @@ NS_IMETHODIMP_(bool) HTMLBRElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::clear }, + { nsGkAtoms::clear }, { nullptr } }; diff --git a/dom/html/HTMLBodyElement.cpp b/dom/html/HTMLBodyElement.cpp index c09e9aaf7541..c3294600560c 100644 --- a/dom/html/HTMLBodyElement.cpp +++ b/dom/html/HTMLBodyElement.cpp @@ -232,16 +232,16 @@ NS_IMETHODIMP_(bool) HTMLBodyElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::link }, - { &nsGkAtoms::vlink }, - { &nsGkAtoms::alink }, - { &nsGkAtoms::text }, - { &nsGkAtoms::marginwidth }, - { &nsGkAtoms::marginheight }, - { &nsGkAtoms::topmargin }, - { &nsGkAtoms::rightmargin }, - { &nsGkAtoms::bottommargin }, - { &nsGkAtoms::leftmargin }, + { nsGkAtoms::link }, + { nsGkAtoms::vlink }, + { nsGkAtoms::alink }, + { nsGkAtoms::text }, + { nsGkAtoms::marginwidth }, + { nsGkAtoms::marginheight }, + { nsGkAtoms::topmargin }, + { nsGkAtoms::rightmargin }, + { nsGkAtoms::bottommargin }, + { nsGkAtoms::leftmargin }, { nullptr }, }; diff --git a/dom/html/HTMLFontElement.cpp b/dom/html/HTMLFontElement.cpp index a6bbbc686513..abf25847d6a7 100644 --- a/dom/html/HTMLFontElement.cpp +++ b/dom/html/HTMLFontElement.cpp @@ -97,9 +97,9 @@ NS_IMETHODIMP_(bool) HTMLFontElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::face }, - { &nsGkAtoms::size }, - { &nsGkAtoms::color }, + { nsGkAtoms::face }, + { nsGkAtoms::size }, + { nsGkAtoms::color }, { nullptr } }; diff --git a/dom/html/HTMLHRElement.cpp b/dom/html/HTMLHRElement.cpp index a92b1e1e3bc3..56a52ad78730 100644 --- a/dom/html/HTMLHRElement.cpp +++ b/dom/html/HTMLHRElement.cpp @@ -173,11 +173,11 @@ NS_IMETHODIMP_(bool) HTMLHRElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::align }, - { &nsGkAtoms::width }, - { &nsGkAtoms::size }, - { &nsGkAtoms::color }, - { &nsGkAtoms::noshade }, + { nsGkAtoms::align }, + { nsGkAtoms::width }, + { nsGkAtoms::size }, + { nsGkAtoms::color }, + { nsGkAtoms::noshade }, { nullptr }, }; diff --git a/dom/html/HTMLIFrameElement.cpp b/dom/html/HTMLIFrameElement.cpp index 7792cc965eaa..273487311ee6 100644 --- a/dom/html/HTMLIFrameElement.cpp +++ b/dom/html/HTMLIFrameElement.cpp @@ -131,9 +131,9 @@ NS_IMETHODIMP_(bool) HTMLIFrameElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::width }, - { &nsGkAtoms::height }, - { &nsGkAtoms::frameborder }, + { nsGkAtoms::width }, + { nsGkAtoms::height }, + { nsGkAtoms::frameborder }, { nullptr }, }; diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 585e07b34f51..a17855a722b6 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -5652,7 +5652,7 @@ NS_IMETHODIMP_(bool) HTMLInputElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::align }, + { nsGkAtoms::align }, { nullptr }, }; diff --git a/dom/html/HTMLLIElement.cpp b/dom/html/HTMLLIElement.cpp index c5c82b9ef61c..be21852180fe 100644 --- a/dom/html/HTMLLIElement.cpp +++ b/dom/html/HTMLLIElement.cpp @@ -83,7 +83,7 @@ NS_IMETHODIMP_(bool) HTMLLIElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::type }, + { nsGkAtoms::type }, { nullptr }, }; diff --git a/dom/html/HTMLLinkElement.cpp b/dom/html/HTMLLinkElement.cpp index 496ae5c748d3..e5dc0ec0c17a 100644 --- a/dom/html/HTMLLinkElement.cpp +++ b/dom/html/HTMLLinkElement.cpp @@ -241,7 +241,7 @@ HTMLLinkElement::CreateAndDispatchEvent(nsIDocument* aDoc, // doing the "right" thing costs virtually nothing here, even if it doesn't // make much sense. static Element::AttrValuesArray strings[] = - {&nsGkAtoms::_empty, &nsGkAtoms::stylesheet, nullptr}; + {nsGkAtoms::_empty, nsGkAtoms::stylesheet, nullptr}; if (!nsContentUtils::HasNonEmptyAttr(this, kNameSpaceID_None, nsGkAtoms::rev) && diff --git a/dom/html/HTMLPreElement.cpp b/dom/html/HTMLPreElement.cpp index 7c5233c95b94..18209a567a86 100644 --- a/dom/html/HTMLPreElement.cpp +++ b/dom/html/HTMLPreElement.cpp @@ -62,7 +62,7 @@ HTMLPreElement::IsAttributeMapped(const nsAtom* aAttribute) const } static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::wrap }, + { nsGkAtoms::wrap }, { nullptr }, }; diff --git a/dom/html/HTMLSharedElement.cpp b/dom/html/HTMLSharedElement.cpp index 94c885b26052..8ae6860851d6 100644 --- a/dom/html/HTMLSharedElement.cpp +++ b/dom/html/HTMLSharedElement.cpp @@ -122,8 +122,8 @@ HTMLSharedElement::IsAttributeMapped(const nsAtom* aAttribute) const { if (mNodeInfo->Equals(nsGkAtoms::dir)) { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::type }, - // { &nsGkAtoms::compact }, // XXX + { nsGkAtoms::type }, + // { nsGkAtoms::compact }, // XXX { nullptr} }; diff --git a/dom/html/HTMLSharedListElement.cpp b/dom/html/HTMLSharedListElement.cpp index c3092d6d0293..4d21ee1fc27f 100644 --- a/dom/html/HTMLSharedListElement.cpp +++ b/dom/html/HTMLSharedListElement.cpp @@ -100,7 +100,7 @@ HTMLSharedListElement::IsAttributeMapped(const nsAtom* aAttribute) const if (mNodeInfo->Equals(nsGkAtoms::ol) || mNodeInfo->Equals(nsGkAtoms::ul)) { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::type }, + { nsGkAtoms::type }, { nullptr } }; diff --git a/dom/html/HTMLTableCaptionElement.cpp b/dom/html/HTMLTableCaptionElement.cpp index e59c97a3d9ce..c808a9b31ac6 100644 --- a/dom/html/HTMLTableCaptionElement.cpp +++ b/dom/html/HTMLTableCaptionElement.cpp @@ -68,7 +68,7 @@ NS_IMETHODIMP_(bool) HTMLTableCaptionElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::align }, + { nsGkAtoms::align }, { nullptr } }; diff --git a/dom/html/HTMLTableCellElement.cpp b/dom/html/HTMLTableCellElement.cpp index 120f4cbc91a4..6a3b73a19fd6 100644 --- a/dom/html/HTMLTableCellElement.cpp +++ b/dom/html/HTMLTableCellElement.cpp @@ -237,19 +237,19 @@ NS_IMETHODIMP_(bool) HTMLTableCellElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::align }, - { &nsGkAtoms::valign }, - { &nsGkAtoms::nowrap }, + { nsGkAtoms::align }, + { nsGkAtoms::valign }, + { nsGkAtoms::nowrap }, #if 0 // XXXldb If these are implemented, they might need to move to // GetAttributeChangeHint (depending on how, and preferably not). - { &nsGkAtoms::abbr }, - { &nsGkAtoms::axis }, - { &nsGkAtoms::headers }, - { &nsGkAtoms::scope }, + { nsGkAtoms::abbr }, + { nsGkAtoms::axis }, + { nsGkAtoms::headers }, + { nsGkAtoms::scope }, #endif - { &nsGkAtoms::width }, - { &nsGkAtoms::height }, + { nsGkAtoms::width }, + { nsGkAtoms::height }, { nullptr } }; diff --git a/dom/html/HTMLTableColElement.cpp b/dom/html/HTMLTableColElement.cpp index 25b135294d60..954be5a44921 100644 --- a/dom/html/HTMLTableColElement.cpp +++ b/dom/html/HTMLTableColElement.cpp @@ -91,10 +91,10 @@ NS_IMETHODIMP_(bool) HTMLTableColElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::width }, - { &nsGkAtoms::align }, - { &nsGkAtoms::valign }, - { &nsGkAtoms::span }, + { nsGkAtoms::width }, + { nsGkAtoms::align }, + { nsGkAtoms::valign }, + { nsGkAtoms::span }, { nullptr } }; diff --git a/dom/html/HTMLTableElement.cpp b/dom/html/HTMLTableElement.cpp index 5950291b8987..f06bad22e470 100644 --- a/dom/html/HTMLTableElement.cpp +++ b/dom/html/HTMLTableElement.cpp @@ -1016,17 +1016,17 @@ NS_IMETHODIMP_(bool) HTMLTableElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::cellpadding }, - { &nsGkAtoms::cellspacing }, - { &nsGkAtoms::border }, - { &nsGkAtoms::width }, - { &nsGkAtoms::height }, - { &nsGkAtoms::hspace }, - { &nsGkAtoms::vspace }, + { nsGkAtoms::cellpadding }, + { nsGkAtoms::cellspacing }, + { nsGkAtoms::border }, + { nsGkAtoms::width }, + { nsGkAtoms::height }, + { nsGkAtoms::hspace }, + { nsGkAtoms::vspace }, - { &nsGkAtoms::bordercolor }, + { nsGkAtoms::bordercolor }, - { &nsGkAtoms::align }, + { nsGkAtoms::align }, { nullptr } }; diff --git a/dom/html/HTMLTableRowElement.cpp b/dom/html/HTMLTableRowElement.cpp index dc5a8ba98a23..8a6bec8b4f14 100644 --- a/dom/html/HTMLTableRowElement.cpp +++ b/dom/html/HTMLTableRowElement.cpp @@ -273,9 +273,9 @@ NS_IMETHODIMP_(bool) HTMLTableRowElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::align }, - { &nsGkAtoms::valign }, - { &nsGkAtoms::height }, + { nsGkAtoms::align }, + { nsGkAtoms::valign }, + { nsGkAtoms::height }, { nullptr } }; diff --git a/dom/html/HTMLTableSectionElement.cpp b/dom/html/HTMLTableSectionElement.cpp index 04a9aeb58bf3..d7dd7549a134 100644 --- a/dom/html/HTMLTableSectionElement.cpp +++ b/dom/html/HTMLTableSectionElement.cpp @@ -181,9 +181,9 @@ NS_IMETHODIMP_(bool) HTMLTableSectionElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::align }, - { &nsGkAtoms::valign }, - { &nsGkAtoms::height }, + { nsGkAtoms::align }, + { nsGkAtoms::valign }, + { nsGkAtoms::height }, { nullptr } }; diff --git a/dom/html/HTMLTextAreaElement.cpp b/dom/html/HTMLTextAreaElement.cpp index 0f4f8d503f50..a475f34f74d7 100644 --- a/dom/html/HTMLTextAreaElement.cpp +++ b/dom/html/HTMLTextAreaElement.cpp @@ -461,7 +461,7 @@ NS_IMETHODIMP_(bool) HTMLTextAreaElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::wrap }, + { nsGkAtoms::wrap }, { nullptr } }; diff --git a/dom/html/HTMLVideoElement.cpp b/dom/html/HTMLVideoElement.cpp index 121624881c17..675debbca33b 100644 --- a/dom/html/HTMLVideoElement.cpp +++ b/dom/html/HTMLVideoElement.cpp @@ -111,8 +111,8 @@ NS_IMETHODIMP_(bool) HTMLVideoElement::IsAttributeMapped(const nsAtom* aAttribute) const { static const MappedAttributeEntry attributes[] = { - { &nsGkAtoms::width }, - { &nsGkAtoms::height }, + { nsGkAtoms::width }, + { nsGkAtoms::height }, { nullptr } }; diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index c1adb2a223b7..e485461128d4 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -322,7 +322,7 @@ nsGenericHTMLElement::Spellcheck() for (node = this; node; node = node->GetParent()) { if (node->IsHTMLElement()) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::_true, &nsGkAtoms::_false, nullptr}; + {nsGkAtoms::_true, nsGkAtoms::_false, nullptr}; switch (node->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck, strings, eCaseMatters)) { @@ -1221,49 +1221,49 @@ nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttribu /* static */ const nsGenericHTMLElement::MappedAttributeEntry nsGenericHTMLElement::sCommonAttributeMap[] = { - { &nsGkAtoms::contenteditable }, - { &nsGkAtoms::lang }, - { &nsGkAtoms::hidden }, + { nsGkAtoms::contenteditable }, + { nsGkAtoms::lang }, + { nsGkAtoms::hidden }, { nullptr } }; /* static */ const Element::MappedAttributeEntry nsGenericHTMLElement::sImageMarginSizeAttributeMap[] = { - { &nsGkAtoms::width }, - { &nsGkAtoms::height }, - { &nsGkAtoms::hspace }, - { &nsGkAtoms::vspace }, + { nsGkAtoms::width }, + { nsGkAtoms::height }, + { nsGkAtoms::hspace }, + { nsGkAtoms::vspace }, { nullptr } }; /* static */ const Element::MappedAttributeEntry nsGenericHTMLElement::sImageAlignAttributeMap[] = { - { &nsGkAtoms::align }, + { nsGkAtoms::align }, { nullptr } }; /* static */ const Element::MappedAttributeEntry nsGenericHTMLElement::sDivAlignAttributeMap[] = { - { &nsGkAtoms::align }, + { nsGkAtoms::align }, { nullptr } }; /* static */ const Element::MappedAttributeEntry nsGenericHTMLElement::sImageBorderAttributeMap[] = { - { &nsGkAtoms::border }, + { nsGkAtoms::border }, { nullptr } }; /* static */ const Element::MappedAttributeEntry nsGenericHTMLElement::sBackgroundAttributeMap[] = { - { &nsGkAtoms::background }, - { &nsGkAtoms::bgcolor }, + { nsGkAtoms::background }, + { nsGkAtoms::bgcolor }, { nullptr } }; /* static */ const Element::MappedAttributeEntry nsGenericHTMLElement::sBackgroundColorAttributeMap[] = { - { &nsGkAtoms::bgcolor }, + { nsGkAtoms::bgcolor }, { nullptr } }; diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h index 95a834f9ec64..5ef4e08f3fd0 100644 --- a/dom/html/nsGenericHTMLElement.h +++ b/dom/html/nsGenericHTMLElement.h @@ -903,7 +903,7 @@ protected: ContentEditableTristate GetContentEditableValue() const { static const Element::AttrValuesArray values[] = - { &nsGkAtoms::_false, &nsGkAtoms::_true, &nsGkAtoms::_empty, nullptr }; + { nsGkAtoms::_false, nsGkAtoms::_true, nsGkAtoms::_empty, nullptr }; if (!MayHaveContentEditableAttr()) return eInherit; diff --git a/dom/html/nsTextEditorState.cpp b/dom/html/nsTextEditorState.cpp index 6a52b443aa9b..de603b8e1026 100644 --- a/dom/html/nsTextEditorState.cpp +++ b/dom/html/nsTextEditorState.cpp @@ -234,7 +234,7 @@ nsITextControlElement::GetWrapPropertyEnum(nsIContent* aContent, nsAutoString wrap; if (aContent->IsHTMLElement()) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::HARD, &nsGkAtoms::OFF, nullptr}; + {nsGkAtoms::HARD, nsGkAtoms::OFF, nullptr}; switch (aContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::wrap, strings, diff --git a/dom/mathml/nsMathMLElement.cpp b/dom/mathml/nsMathMLElement.cpp index 43f71d525293..8c4aa6b6ec5b 100644 --- a/dom/mathml/nsMathMLElement.cpp +++ b/dom/mathml/nsMathMLElement.cpp @@ -165,37 +165,37 @@ nsMathMLElement::ParseAttribute(int32_t aNamespaceID, } static Element::MappedAttributeEntry sMtableStyles[] = { - { &nsGkAtoms::width }, + { nsGkAtoms::width }, { nullptr } }; static Element::MappedAttributeEntry sTokenStyles[] = { - { &nsGkAtoms::mathsize_ }, - { &nsGkAtoms::fontsize_ }, - { &nsGkAtoms::color }, - { &nsGkAtoms::fontfamily_ }, - { &nsGkAtoms::fontstyle_ }, - { &nsGkAtoms::fontweight_ }, - { &nsGkAtoms::mathvariant_}, + { nsGkAtoms::mathsize_ }, + { nsGkAtoms::fontsize_ }, + { nsGkAtoms::color }, + { nsGkAtoms::fontfamily_ }, + { nsGkAtoms::fontstyle_ }, + { nsGkAtoms::fontweight_ }, + { nsGkAtoms::mathvariant_}, { nullptr } }; static Element::MappedAttributeEntry sEnvironmentStyles[] = { - { &nsGkAtoms::scriptlevel_ }, - { &nsGkAtoms::scriptminsize_ }, - { &nsGkAtoms::scriptsizemultiplier_ }, - { &nsGkAtoms::background }, + { nsGkAtoms::scriptlevel_ }, + { nsGkAtoms::scriptminsize_ }, + { nsGkAtoms::scriptsizemultiplier_ }, + { nsGkAtoms::background }, { nullptr } }; static Element::MappedAttributeEntry sCommonPresStyles[] = { - { &nsGkAtoms::mathcolor_ }, - { &nsGkAtoms::mathbackground_ }, + { nsGkAtoms::mathcolor_ }, + { nsGkAtoms::mathbackground_ }, { nullptr } }; static Element::MappedAttributeEntry sDirStyles[] = { - { &nsGkAtoms::dir }, + { nsGkAtoms::dir }, { nullptr } }; @@ -980,13 +980,13 @@ nsMathMLElement::IsLink(nsIURI** aURI) const // result is poorly specified. Either way, we return false. static Element::AttrValuesArray sTypeVals[] = - { &nsGkAtoms::_empty, &nsGkAtoms::simple, nullptr }; + { nsGkAtoms::_empty, nsGkAtoms::simple, nullptr }; static Element::AttrValuesArray sShowVals[] = - { &nsGkAtoms::_empty, &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr }; + { nsGkAtoms::_empty, nsGkAtoms::_new, nsGkAtoms::replace, nullptr }; static Element::AttrValuesArray sActuateVals[] = - { &nsGkAtoms::_empty, &nsGkAtoms::onRequest, nullptr }; + { nsGkAtoms::_empty, nsGkAtoms::onRequest, nullptr }; // Optimization: check for href first for early return href = mAttrs.GetAttr(nsGkAtoms::href, kNameSpaceID_XLink); @@ -1031,7 +1031,7 @@ nsMathMLElement::GetLinkTarget(nsAString& aTarget) if (aTarget.IsEmpty()) { static Element::AttrValuesArray sShowVals[] = - { &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr }; + { nsGkAtoms::_new, nsGkAtoms::replace, nullptr }; switch (FindAttrValueIn(kNameSpaceID_XLink, nsGkAtoms::show, sShowVals, eCaseMatters)) { diff --git a/dom/svg/SVGAElement.cpp b/dom/svg/SVGAElement.cpp index bf7a47de59a5..2bb8e883fddd 100644 --- a/dom/svg/SVGAElement.cpp +++ b/dom/svg/SVGAElement.cpp @@ -349,13 +349,13 @@ SVGAElement::IsLink(nsIURI** aURI) const // result is poorly specified. Either way, we return false. static Element::AttrValuesArray sTypeVals[] = - { &nsGkAtoms::_empty, &nsGkAtoms::simple, nullptr }; + { nsGkAtoms::_empty, nsGkAtoms::simple, nullptr }; static Element::AttrValuesArray sShowVals[] = - { &nsGkAtoms::_empty, &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr }; + { nsGkAtoms::_empty, nsGkAtoms::_new, nsGkAtoms::replace, nullptr }; static Element::AttrValuesArray sActuateVals[] = - { &nsGkAtoms::_empty, &nsGkAtoms::onRequest, nullptr }; + { nsGkAtoms::_empty, nsGkAtoms::onRequest, nullptr }; // Optimization: check for href first for early return bool useBareHref = mStringAttributes[HREF].IsExplicitlySet(); @@ -391,7 +391,7 @@ SVGAElement::GetLinkTarget(nsAString& aTarget) if (aTarget.IsEmpty()) { static Element::AttrValuesArray sShowVals[] = - { &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr }; + { nsGkAtoms::_new, nsGkAtoms::replace, nullptr }; switch (FindAttrValueIn(kNameSpaceID_XLink, nsGkAtoms::show, sShowVals, eCaseMatters)) { diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp index a443be645639..b69655a56d7b 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/dom/svg/nsSVGElement.cpp @@ -923,38 +923,38 @@ nsSVGElement::IsAttributeMapped(const nsAtom* name) const // PresentationAttributes-FillStroke /* static */ const Element::MappedAttributeEntry nsSVGElement::sFillStrokeMap[] = { - { &nsGkAtoms::fill }, - { &nsGkAtoms::fill_opacity }, - { &nsGkAtoms::fill_rule }, - { &nsGkAtoms::paint_order }, - { &nsGkAtoms::stroke }, - { &nsGkAtoms::stroke_dasharray }, - { &nsGkAtoms::stroke_dashoffset }, - { &nsGkAtoms::stroke_linecap }, - { &nsGkAtoms::stroke_linejoin }, - { &nsGkAtoms::stroke_miterlimit }, - { &nsGkAtoms::stroke_opacity }, - { &nsGkAtoms::stroke_width }, - { &nsGkAtoms::vector_effect }, + { nsGkAtoms::fill }, + { nsGkAtoms::fill_opacity }, + { nsGkAtoms::fill_rule }, + { nsGkAtoms::paint_order }, + { nsGkAtoms::stroke }, + { nsGkAtoms::stroke_dasharray }, + { nsGkAtoms::stroke_dashoffset }, + { nsGkAtoms::stroke_linecap }, + { nsGkAtoms::stroke_linejoin }, + { nsGkAtoms::stroke_miterlimit }, + { nsGkAtoms::stroke_opacity }, + { nsGkAtoms::stroke_width }, + { nsGkAtoms::vector_effect }, { nullptr } }; // PresentationAttributes-Graphics /* static */ const Element::MappedAttributeEntry nsSVGElement::sGraphicsMap[] = { - { &nsGkAtoms::clip_path }, - { &nsGkAtoms::clip_rule }, - { &nsGkAtoms::colorInterpolation }, - { &nsGkAtoms::cursor }, - { &nsGkAtoms::display }, - { &nsGkAtoms::filter }, - { &nsGkAtoms::image_rendering }, - { &nsGkAtoms::mask }, - { &nsGkAtoms::opacity }, - { &nsGkAtoms::pointer_events }, - { &nsGkAtoms::shape_rendering }, - { &nsGkAtoms::text_rendering }, - { &nsGkAtoms::visibility }, + { nsGkAtoms::clip_path }, + { nsGkAtoms::clip_rule }, + { nsGkAtoms::colorInterpolation }, + { nsGkAtoms::cursor }, + { nsGkAtoms::display }, + { nsGkAtoms::filter }, + { nsGkAtoms::image_rendering }, + { nsGkAtoms::mask }, + { nsGkAtoms::opacity }, + { nsGkAtoms::pointer_events }, + { nsGkAtoms::shape_rendering }, + { nsGkAtoms::text_rendering }, + { nsGkAtoms::visibility }, { nullptr } }; @@ -962,90 +962,90 @@ nsSVGElement::sGraphicsMap[] = { /* static */ const Element::MappedAttributeEntry nsSVGElement::sTextContentElementsMap[] = { // Properties that we don't support are commented out. - // { &nsGkAtoms::alignment_baseline }, - // { &nsGkAtoms::baseline_shift }, - { &nsGkAtoms::direction }, - { &nsGkAtoms::dominant_baseline }, - { &nsGkAtoms::letter_spacing }, - { &nsGkAtoms::text_anchor }, - { &nsGkAtoms::text_decoration }, - { &nsGkAtoms::unicode_bidi }, - { &nsGkAtoms::word_spacing }, - { &nsGkAtoms::writing_mode }, + // { nsGkAtoms::alignment_baseline }, + // { nsGkAtoms::baseline_shift }, + { nsGkAtoms::direction }, + { nsGkAtoms::dominant_baseline }, + { nsGkAtoms::letter_spacing }, + { nsGkAtoms::text_anchor }, + { nsGkAtoms::text_decoration }, + { nsGkAtoms::unicode_bidi }, + { nsGkAtoms::word_spacing }, + { nsGkAtoms::writing_mode }, { nullptr } }; // PresentationAttributes-FontSpecification /* static */ const Element::MappedAttributeEntry nsSVGElement::sFontSpecificationMap[] = { - { &nsGkAtoms::font_family }, - { &nsGkAtoms::font_size }, - { &nsGkAtoms::font_size_adjust }, - { &nsGkAtoms::font_stretch }, - { &nsGkAtoms::font_style }, - { &nsGkAtoms::font_variant }, - { &nsGkAtoms::fontWeight }, + { nsGkAtoms::font_family }, + { nsGkAtoms::font_size }, + { nsGkAtoms::font_size_adjust }, + { nsGkAtoms::font_stretch }, + { nsGkAtoms::font_style }, + { nsGkAtoms::font_variant }, + { nsGkAtoms::fontWeight }, { nullptr } }; // PresentationAttributes-GradientStop /* static */ const Element::MappedAttributeEntry nsSVGElement::sGradientStopMap[] = { - { &nsGkAtoms::stop_color }, - { &nsGkAtoms::stop_opacity }, + { nsGkAtoms::stop_color }, + { nsGkAtoms::stop_opacity }, { nullptr } }; // PresentationAttributes-Viewports /* static */ const Element::MappedAttributeEntry nsSVGElement::sViewportsMap[] = { - { &nsGkAtoms::overflow }, - { &nsGkAtoms::clip }, + { nsGkAtoms::overflow }, + { nsGkAtoms::clip }, { nullptr } }; // PresentationAttributes-Makers /* static */ const Element::MappedAttributeEntry nsSVGElement::sMarkersMap[] = { - { &nsGkAtoms::marker_end }, - { &nsGkAtoms::marker_mid }, - { &nsGkAtoms::marker_start }, + { nsGkAtoms::marker_end }, + { nsGkAtoms::marker_mid }, + { nsGkAtoms::marker_start }, { nullptr } }; // PresentationAttributes-Color /* static */ const Element::MappedAttributeEntry nsSVGElement::sColorMap[] = { - { &nsGkAtoms::color }, + { nsGkAtoms::color }, { nullptr } }; // PresentationAttributes-Filters /* static */ const Element::MappedAttributeEntry nsSVGElement::sFiltersMap[] = { - { &nsGkAtoms::colorInterpolationFilters }, + { nsGkAtoms::colorInterpolationFilters }, { nullptr } }; // PresentationAttributes-feFlood /* static */ const Element::MappedAttributeEntry nsSVGElement::sFEFloodMap[] = { - { &nsGkAtoms::flood_color }, - { &nsGkAtoms::flood_opacity }, + { nsGkAtoms::flood_color }, + { nsGkAtoms::flood_opacity }, { nullptr } }; // PresentationAttributes-LightingEffects /* static */ const Element::MappedAttributeEntry nsSVGElement::sLightingEffectsMap[] = { - { &nsGkAtoms::lighting_color }, + { nsGkAtoms::lighting_color }, { nullptr } }; // PresentationAttributes-mask /* static */ const Element::MappedAttributeEntry nsSVGElement::sMaskMap[] = { - { &nsGkAtoms::mask_type }, + { nsGkAtoms::mask_type }, { nullptr } }; diff --git a/dom/xbl/nsXBLPrototypeBinding.cpp b/dom/xbl/nsXBLPrototypeBinding.cpp index a436c2feb99d..2a54d0d5463a 100644 --- a/dom/xbl/nsXBLPrototypeBinding.cpp +++ b/dom/xbl/nsXBLPrototypeBinding.cpp @@ -1547,16 +1547,16 @@ nsXBLPrototypeBinding::WriteNamespace(nsIObjectOutputStream* aStream, bool CheckTagNameWhiteList(int32_t aNameSpaceID, nsAtom *aTagName) { static Element::AttrValuesArray kValidXULTagNames[] = { - &nsGkAtoms::box, &nsGkAtoms::browser, - &nsGkAtoms::button, &nsGkAtoms::hbox, &nsGkAtoms::image, &nsGkAtoms::menu, - &nsGkAtoms::menubar, &nsGkAtoms::menuitem, &nsGkAtoms::menupopup, - &nsGkAtoms::row, &nsGkAtoms::slider, &nsGkAtoms::spacer, - &nsGkAtoms::splitter, &nsGkAtoms::text, &nsGkAtoms::tree, nullptr}; + nsGkAtoms::box, nsGkAtoms::browser, + nsGkAtoms::button, nsGkAtoms::hbox, nsGkAtoms::image, nsGkAtoms::menu, + nsGkAtoms::menubar, nsGkAtoms::menuitem, nsGkAtoms::menupopup, + nsGkAtoms::row, nsGkAtoms::slider, nsGkAtoms::spacer, + nsGkAtoms::splitter, nsGkAtoms::text, nsGkAtoms::tree, nullptr}; uint32_t i; if (aNameSpaceID == kNameSpaceID_XUL) { for (i = 0; kValidXULTagNames[i]; ++i) { - if (aTagName == *(kValidXULTagNames[i])) { + if (aTagName == kValidXULTagNames[i]) { return true; } } diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp index 6cf71027a674..58f00cc66379 100644 --- a/dom/xul/XULDocument.cpp +++ b/dom/xul/XULDocument.cpp @@ -2442,7 +2442,7 @@ XULDocument::IsDocumentRightToLeft() Element* element = GetRootElement(); if (element) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::ltr, &nsGkAtoms::rtl, nullptr}; + {nsGkAtoms::ltr, nsGkAtoms::rtl, nullptr}; switch (element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::localedir, strings, eCaseMatters)) { case 0: return false; diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp index a6fdab55bacc..4c1d12e38d26 100644 --- a/layout/base/PositionedEventTargeting.cpp +++ b/layout/base/PositionedEventTargeting.cpp @@ -249,7 +249,7 @@ GetClickableAncestor(nsIFrame* aFrame, nsAtom* stopAt = nullptr, nsAutoString* a } static Element::AttrValuesArray clickableRoles[] = - { &nsGkAtoms::button, &nsGkAtoms::key, nullptr }; + { nsGkAtoms::button, nsGkAtoms::key, nullptr }; if (content->IsElement() && content->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::role, clickableRoles, eIgnoreCase) >= 0) { diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp index 2a4c895989c9..3f0017a0a0a3 100644 --- a/layout/generic/nsImageMap.cpp +++ b/layout/generic/nsImageMap.cpp @@ -797,10 +797,10 @@ void nsImageMap::AddArea(HTMLAreaElement* aArea) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::rect, &nsGkAtoms::rectangle, - &nsGkAtoms::circle, &nsGkAtoms::circ, - &nsGkAtoms::_default, - &nsGkAtoms::poly, &nsGkAtoms::polygon, + {nsGkAtoms::rect, nsGkAtoms::rectangle, + nsGkAtoms::circle, nsGkAtoms::circ, + nsGkAtoms::_default, + nsGkAtoms::poly, nsGkAtoms::polygon, nullptr}; UniquePtr area; diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp index 471269742f40..2df091546ec9 100644 --- a/layout/xul/nsBoxFrame.cpp +++ b/layout/xul/nsBoxFrame.cpp @@ -178,7 +178,7 @@ nsBoxFrame::Init(nsIContent* aContent, void nsBoxFrame::UpdateMouseThrough() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::never, &nsGkAtoms::always, nullptr}; + {nsGkAtoms::never, nsGkAtoms::always, nullptr}; switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::mousethrough, strings, eCaseMatters)) { case 0: AddStateBits(NS_FRAME_MOUSE_THROUGH_NEVER); break; @@ -244,7 +244,7 @@ nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign) Element* element = GetContent()->AsElement(); // XXXdwh Everything inside this if statement is deprecated code. static Element::AttrValuesArray alignStrings[] = - {&nsGkAtoms::left, &nsGkAtoms::right, nullptr}; + {nsGkAtoms::left, nsGkAtoms::right, nullptr}; static const Halignment alignValues[] = {hAlign_Left, hAlign_Right}; int32_t index = element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::align, alignStrings, eCaseMatters); @@ -258,7 +258,7 @@ nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign) // we are checking the ALIGN attribute. nsAtom* attrName = IsXULHorizontal() ? nsGkAtoms::pack : nsGkAtoms::align; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::_empty, &nsGkAtoms::start, &nsGkAtoms::center, &nsGkAtoms::end, nullptr}; + {nsGkAtoms::_empty, nsGkAtoms::start, nsGkAtoms::center, nsGkAtoms::end, nullptr}; static const Halignment values[] = {hAlign_Left/*not used*/, hAlign_Left, hAlign_Center, hAlign_Right}; index = element->FindAttrValueIn(kNameSpaceID_None, attrName, @@ -320,7 +320,7 @@ nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign) Element* element = GetContent()->AsElement(); static Element::AttrValuesArray valignStrings[] = - {&nsGkAtoms::top, &nsGkAtoms::baseline, &nsGkAtoms::middle, &nsGkAtoms::bottom, nullptr}; + {nsGkAtoms::top, nsGkAtoms::baseline, nsGkAtoms::middle, nsGkAtoms::bottom, nullptr}; static const Valignment valignValues[] = {vAlign_Top, vAlign_BaseLine, vAlign_Middle, vAlign_Bottom}; int32_t index = element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::valign, @@ -335,8 +335,8 @@ nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign) // we are checking the PACK attribute. nsAtom* attrName = IsXULHorizontal() ? nsGkAtoms::align : nsGkAtoms::pack; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::_empty, &nsGkAtoms::start, &nsGkAtoms::center, - &nsGkAtoms::baseline, &nsGkAtoms::end, nullptr}; + {nsGkAtoms::_empty, nsGkAtoms::start, nsGkAtoms::center, + nsGkAtoms::baseline, nsGkAtoms::end, nullptr}; static const Valignment values[] = {vAlign_Top/*not used*/, vAlign_Top, vAlign_Middle, vAlign_BaseLine, vAlign_Bottom}; index = element->FindAttrValueIn(kNameSpaceID_None, attrName, @@ -412,7 +412,7 @@ nsBoxFrame::GetInitialOrientation(bool& aIsHorizontal) return; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::vertical, &nsGkAtoms::horizontal, nullptr}; + {nsGkAtoms::vertical, nsGkAtoms::horizontal, nullptr}; int32_t index = GetContent()->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::orient, strings, eCaseMatters); @@ -451,7 +451,7 @@ nsBoxFrame::GetInitialDirection(bool& aIsNormal) // the style system value. if (IsXULHorizontal()) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::reverse, &nsGkAtoms::ltr, &nsGkAtoms::rtl, nullptr}; + {nsGkAtoms::reverse, nsGkAtoms::ltr, nsGkAtoms::rtl, nullptr}; int32_t index = element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::dir, strings, eCaseMatters); if (index >= 0) { @@ -494,7 +494,7 @@ nsBoxFrame::GetInitialAutoStretch(bool& aStretch) // Check the align attribute. if (GetContent()->IsElement()) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::_empty, &nsGkAtoms::stretch, nullptr}; + {nsGkAtoms::_empty, nsGkAtoms::stretch, nullptr}; int32_t index = GetContent()->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::align, strings, eCaseMatters); diff --git a/layout/xul/nsImageBoxFrame.cpp b/layout/xul/nsImageBoxFrame.cpp index 44f8909853d0..880c07c211c8 100644 --- a/layout/xul/nsImageBoxFrame.cpp +++ b/layout/xul/nsImageBoxFrame.cpp @@ -301,7 +301,7 @@ void nsImageBoxFrame::UpdateLoadFlags() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::always, &nsGkAtoms::never, nullptr}; + {nsGkAtoms::always, nsGkAtoms::never, nullptr}; switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::validate, strings, eCaseMatters)) { diff --git a/layout/xul/nsLeafBoxFrame.cpp b/layout/xul/nsLeafBoxFrame.cpp index 7c450cf63961..4c719ba49a5e 100644 --- a/layout/xul/nsLeafBoxFrame.cpp +++ b/layout/xul/nsLeafBoxFrame.cpp @@ -75,7 +75,7 @@ nsLeafBoxFrame::AttributeChanged(int32_t aNameSpaceID, void nsLeafBoxFrame::UpdateMouseThrough() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::never, &nsGkAtoms::always, nullptr}; + {nsGkAtoms::never, nsGkAtoms::always, nullptr}; switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::mousethrough, strings, eCaseMatters)) { diff --git a/layout/xul/nsMenuFrame.cpp b/layout/xul/nsMenuFrame.cpp index b7126ec6679e..db286e3aa887 100644 --- a/layout/xul/nsMenuFrame.cpp +++ b/layout/xul/nsMenuFrame.cpp @@ -904,7 +904,7 @@ void nsMenuFrame::UpdateMenuType() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr}; + {nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr}; switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings, eCaseMatters)) { diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index f8368b4ba580..b1b116c77dad 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -223,7 +223,7 @@ nsMenuPopupFrame::PopupLevel(bool aIsNoAutoHide) const // If the level attribute has been set, use that. static Element::AttrValuesArray strings[] = - {&nsGkAtoms::top, &nsGkAtoms::parent, &nsGkAtoms::floating, nullptr}; + {nsGkAtoms::top, nsGkAtoms::parent, nsGkAtoms::floating, nullptr}; switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::level, strings, eCaseMatters)) { diff --git a/layout/xul/nsResizerFrame.cpp b/layout/xul/nsResizerFrame.cpp index 0c7f1162dbe1..9ec3bb827a10 100644 --- a/layout/xul/nsResizerFrame.cpp +++ b/layout/xul/nsResizerFrame.cpp @@ -493,10 +493,10 @@ nsResizerFrame::Direction nsResizerFrame::GetDirection() { static const Element::AttrValuesArray strings[] = - {&nsGkAtoms::topleft, &nsGkAtoms::top, &nsGkAtoms::topright, - &nsGkAtoms::left, &nsGkAtoms::right, - &nsGkAtoms::bottomleft, &nsGkAtoms::bottom, &nsGkAtoms::bottomright, - &nsGkAtoms::bottomstart, &nsGkAtoms::bottomend, + {nsGkAtoms::topleft, nsGkAtoms::top, nsGkAtoms::topright, + nsGkAtoms::left, nsGkAtoms::right, + nsGkAtoms::bottomleft, nsGkAtoms::bottom, nsGkAtoms::bottomright, + nsGkAtoms::bottomstart, nsGkAtoms::bottomend, nullptr}; static const Direction directions[] = diff --git a/layout/xul/nsScrollbarButtonFrame.cpp b/layout/xul/nsScrollbarButtonFrame.cpp index 122a3e170598..63a53de9857d 100644 --- a/layout/xul/nsScrollbarButtonFrame.cpp +++ b/layout/xul/nsScrollbarButtonFrame.cpp @@ -113,8 +113,8 @@ nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext, if (scrollbar == nullptr) return false; - static Element::AttrValuesArray strings[] = { &nsGkAtoms::increment, - &nsGkAtoms::decrement, + static Element::AttrValuesArray strings[] = { nsGkAtoms::increment, + nsGkAtoms::decrement, nullptr }; int32_t index = mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, diff --git a/layout/xul/nsSplitterFrame.cpp b/layout/xul/nsSplitterFrame.cpp index 9fb3846b4f17..7aa7c7bded65 100644 --- a/layout/xul/nsSplitterFrame.cpp +++ b/layout/xul/nsSplitterFrame.cpp @@ -142,7 +142,7 @@ nsSplitterFrameInner::ResizeType nsSplitterFrameInner::GetResizeBefore() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::farthest, &nsGkAtoms::flex, nullptr}; + {nsGkAtoms::farthest, nsGkAtoms::flex, nullptr}; switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::resizebefore, strings, eCaseMatters)) { @@ -160,7 +160,7 @@ nsSplitterFrameInner::ResizeType nsSplitterFrameInner::GetResizeAfter() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::farthest, &nsGkAtoms::flex, &nsGkAtoms::grow, nullptr}; + {nsGkAtoms::farthest, nsGkAtoms::flex, nsGkAtoms::grow, nullptr}; switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::resizeafter, strings, eCaseMatters)) { @@ -175,9 +175,9 @@ nsSplitterFrameInner::State nsSplitterFrameInner::GetState() { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::dragging, &nsGkAtoms::collapsed, nullptr}; + {nsGkAtoms::dragging, nsGkAtoms::collapsed, nullptr}; static Element::AttrValuesArray strings_substate[] = - {&nsGkAtoms::before, &nsGkAtoms::after, nullptr}; + {nsGkAtoms::before, nsGkAtoms::after, nullptr}; switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::state, strings, eCaseMatters)) { @@ -802,7 +802,7 @@ nsSplitterFrameInner::SupportsCollapseDirection ) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::before, &nsGkAtoms::after, &nsGkAtoms::both, nullptr}; + {nsGkAtoms::before, nsGkAtoms::after, nsGkAtoms::both, nullptr}; switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::collapse, diff --git a/layout/xul/nsTextBoxFrame.cpp b/layout/xul/nsTextBoxFrame.cpp index a183632adc6b..eccda3bbed7b 100644 --- a/layout/xul/nsTextBoxFrame.cpp +++ b/layout/xul/nsTextBoxFrame.cpp @@ -227,8 +227,8 @@ nsTextBoxFrame::UpdateAttributes(nsAtom* aAttribute, if (aAttribute == nullptr || aAttribute == nsGkAtoms::crop) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::left, &nsGkAtoms::start, &nsGkAtoms::center, - &nsGkAtoms::right, &nsGkAtoms::end, &nsGkAtoms::none, nullptr}; + {nsGkAtoms::left, nsGkAtoms::start, nsGkAtoms::center, + nsGkAtoms::right, nsGkAtoms::end, nsGkAtoms::none, nullptr}; CroppingStyle cropType; switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::crop, strings, diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index a87331285f64..d7cfa4f71b2d 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -1347,7 +1347,7 @@ nsXULPopupManager::ExecuteMenu(nsIContent* aMenu, nsXULMenuCommandEvent* aEvent) CloseMenuMode cmm = CloseMenuMode_Auto; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::none, &nsGkAtoms::single, nullptr}; + {nsGkAtoms::none, nsGkAtoms::single, nullptr}; if (aMenu->IsElement()) { switch (aMenu->AsElement()->FindAttrValueIn(kNameSpaceID_None, diff --git a/layout/xul/tree/nsTreeColumns.cpp b/layout/xul/tree/nsTreeColumns.cpp index f53dd8805659..ac750030d3dc 100644 --- a/layout/xul/tree/nsTreeColumns.cpp +++ b/layout/xul/tree/nsTreeColumns.cpp @@ -213,8 +213,7 @@ nsTreeColumn::Invalidate(ErrorResult& aRv) // Figure out our column type. Default type is text. mType = TreeColumn_Binding::TYPE_TEXT; static Element::AttrValuesArray typestrings[] = - {&nsGkAtoms::checkbox, &nsGkAtoms::password, - nullptr}; + {nsGkAtoms::checkbox, nsGkAtoms::password, nullptr}; switch (mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, typestrings, @@ -226,7 +225,7 @@ nsTreeColumn::Invalidate(ErrorResult& aRv) // Fetch the crop style. mCropStyle = 0; static Element::AttrValuesArray cropstrings[] = - {&nsGkAtoms::center, &nsGkAtoms::left, &nsGkAtoms::start, nullptr}; + {nsGkAtoms::center, nsGkAtoms::left, nsGkAtoms::start, nullptr}; switch (mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::crop, cropstrings, eCaseMatters)) { diff --git a/layout/xul/tree/nsTreeContentView.cpp b/layout/xul/tree/nsTreeContentView.cpp index 7afa42541dfd..12b9e2833b0f 100644 --- a/layout/xul/tree/nsTreeContentView.cpp +++ b/layout/xul/tree/nsTreeContentView.cpp @@ -662,7 +662,7 @@ nsTreeContentView::CycleHeader(nsTreeColumn& aColumn, ErrorResult& aError) if (!sort.IsEmpty()) { nsAutoString sortdirection; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::ascending, &nsGkAtoms::descending, nullptr}; + {nsGkAtoms::ascending, nsGkAtoms::descending, nullptr}; switch (column->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::sortDirection, strings, eCaseMatters)) { diff --git a/layout/xul/tree/nsTreeSelection.cpp b/layout/xul/tree/nsTreeSelection.cpp index ae3a8b0a6053..b56bb2764ccd 100644 --- a/layout/xul/tree/nsTreeSelection.cpp +++ b/layout/xul/tree/nsTreeSelection.cpp @@ -292,7 +292,7 @@ NS_IMETHODIMP nsTreeSelection::SetTree(nsITreeBoxObject * aTree) NS_IMETHODIMP nsTreeSelection::GetSingle(bool* aSingle) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::single, &nsGkAtoms::cell, &nsGkAtoms::text, nullptr}; + {nsGkAtoms::single, nsGkAtoms::cell, nsGkAtoms::text, nullptr}; nsCOMPtr content = GetContent(); if (!content) { diff --git a/widget/cocoa/nsMenuX.mm b/widget/cocoa/nsMenuX.mm index 3dfa162633ec..f9818c3274f3 100644 --- a/widget/cocoa/nsMenuX.mm +++ b/widget/cocoa/nsMenuX.mm @@ -515,7 +515,7 @@ void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent) itemType = eSeparatorMenuItemType; } else if (inMenuItemContent->IsElement()) { static Element::AttrValuesArray strings[] = - {&nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr}; + {nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr}; switch (inMenuItemContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings, eCaseMatters)) { diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp index 61370abc601c..eea83f53b4b8 100644 --- a/widget/nsNativeTheme.cpp +++ b/widget/nsNativeTheme.cpp @@ -413,8 +413,8 @@ nsNativeTheme::GetScrollbarButtonType(nsIFrame* aFrame) return 0; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::scrollbarDownBottom, &nsGkAtoms::scrollbarDownTop, - &nsGkAtoms::scrollbarUpBottom, &nsGkAtoms::scrollbarUpTop, + {nsGkAtoms::scrollbarDownBottom, nsGkAtoms::scrollbarDownTop, + nsGkAtoms::scrollbarUpBottom, nsGkAtoms::scrollbarUpTop, nullptr}; nsIContent* content = aFrame->GetContent(); @@ -442,7 +442,7 @@ nsNativeTheme::GetTreeSortDirection(nsIFrame* aFrame) return eTreeSortDirection_Natural; static Element::AttrValuesArray strings[] = - {&nsGkAtoms::descending, &nsGkAtoms::ascending, nullptr}; + {nsGkAtoms::descending, nsGkAtoms::ascending, nullptr}; nsIContent* content = aFrame->GetContent(); if (content->IsElement()) {