mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 1451169 - Use nsStaticAtom*
instead of nsStaticAtom**
in Element.h. r=baku
--HG-- extra : rebase_source : db09f7ab93a1c41ace03a645623f78a27ecfff8c
This commit is contained in:
parent
fb0c912a86
commit
36c48819d1
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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<nsISupports*>(tmp->GetProperty(*props[i]));
|
||||
static_cast<nsISupports*>(tmp->GetProperty(props[i]));
|
||||
cb.NoteXPCOMChild(property);
|
||||
}
|
||||
if (tmp->MayHaveAnimations()) {
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -67,7 +67,7 @@ NS_IMETHODIMP_(bool)
|
||||
HTMLBRElement::IsAttributeMapped(const nsAtom* aAttribute) const
|
||||
{
|
||||
static const MappedAttributeEntry attributes[] = {
|
||||
{ &nsGkAtoms::clear },
|
||||
{ nsGkAtoms::clear },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
|
@ -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 },
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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 },
|
||||
};
|
||||
|
||||
|
@ -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 },
|
||||
};
|
||||
|
||||
|
@ -5652,7 +5652,7 @@ NS_IMETHODIMP_(bool)
|
||||
HTMLInputElement::IsAttributeMapped(const nsAtom* aAttribute) const
|
||||
{
|
||||
static const MappedAttributeEntry attributes[] = {
|
||||
{ &nsGkAtoms::align },
|
||||
{ nsGkAtoms::align },
|
||||
{ nullptr },
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,7 @@ NS_IMETHODIMP_(bool)
|
||||
HTMLLIElement::IsAttributeMapped(const nsAtom* aAttribute) const
|
||||
{
|
||||
static const MappedAttributeEntry attributes[] = {
|
||||
{ &nsGkAtoms::type },
|
||||
{ nsGkAtoms::type },
|
||||
{ nullptr },
|
||||
};
|
||||
|
||||
|
@ -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) &&
|
||||
|
@ -62,7 +62,7 @@ HTMLPreElement::IsAttributeMapped(const nsAtom* aAttribute) const
|
||||
}
|
||||
|
||||
static const MappedAttributeEntry attributes[] = {
|
||||
{ &nsGkAtoms::wrap },
|
||||
{ nsGkAtoms::wrap },
|
||||
{ nullptr },
|
||||
};
|
||||
|
||||
|
@ -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}
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@ NS_IMETHODIMP_(bool)
|
||||
HTMLTableCaptionElement::IsAttributeMapped(const nsAtom* aAttribute) const
|
||||
{
|
||||
static const MappedAttributeEntry attributes[] = {
|
||||
{ &nsGkAtoms::align },
|
||||
{ nsGkAtoms::align },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -461,7 +461,7 @@ NS_IMETHODIMP_(bool)
|
||||
HTMLTextAreaElement::IsAttributeMapped(const nsAtom* aAttribute) const
|
||||
{
|
||||
static const MappedAttributeEntry attributes[] = {
|
||||
{ &nsGkAtoms::wrap },
|
||||
{ nsGkAtoms::wrap },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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> area;
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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[] =
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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<nsIContent> content = GetContent();
|
||||
if (!content) {
|
||||
|
@ -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)) {
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user