Commit cd8b8939 authored by Simon Giesecke's avatar Simon Giesecke
Browse files

Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by...

Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj

Differential Revision: https://phabricator.services.mozilla.com/D80860
parent 675da382
......@@ -538,7 +538,7 @@ void AccessibleWrap::GetRoleDescription(role aRole,
if (aRole == roles::HEADING && aAttributes) {
// The heading level is an attribute, so we need that.
AutoTArray<nsString, 1> formatString;
nsresult rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("level"),
nsresult rv = aAttributes->GetStringProperty("level"_ns,
*formatString.AppendElement());
if (NS_SUCCEEDED(rv) &&
LocalizeString("headingLevel", aRoleDescription, formatString)) {
......@@ -548,8 +548,8 @@ void AccessibleWrap::GetRoleDescription(role aRole,
if ((aRole == roles::LANDMARK || aRole == roles::REGION) && aAttributes) {
nsAutoString xmlRoles;
if (NS_SUCCEEDED(aAttributes->GetStringProperty(
NS_LITERAL_CSTRING("xml-roles"), xmlRoles))) {
if (NS_SUCCEEDED(
aAttributes->GetStringProperty("xml-roles"_ns, xmlRoles))) {
nsWhitespaceTokenizer tokenizer(xmlRoles);
while (tokenizer.hasMoreTokens()) {
if (LocalizeString(NS_ConvertUTF16toUTF8(tokenizer.nextToken()).get(),
......@@ -798,8 +798,7 @@ mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle(
}
nsString posinset;
nsresult rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("posinset"),
posinset);
nsresult rv = aAttributes->GetStringProperty("posinset"_ns, posinset);
if (NS_SUCCEEDED(rv)) {
int32_t rowIndex;
if (sscanf(NS_ConvertUTF16toUTF8(posinset).get(), "%d", &rowIndex) > 0) {
......@@ -819,8 +818,7 @@ mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle(
}
nsString colSize;
rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("child-item-count"),
colSize);
rv = aAttributes->GetStringProperty("child-item-count"_ns, colSize);
if (NS_SUCCEEDED(rv)) {
int32_t rowCount;
if (sscanf(NS_ConvertUTF16toUTF8(colSize).get(), "%d", &rowCount) > 0) {
......@@ -831,8 +829,7 @@ mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle(
java::sdk::Integer::ValueOf(1));
nsString unused;
rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("hierarchical"),
unused);
rv = aAttributes->GetStringProperty("hierarchical"_ns, unused);
if (NS_SUCCEEDED(rv)) {
GECKOBUNDLE_PUT(collectionInfo, "isHierarchical",
java::sdk::Boolean::TRUE());
......@@ -897,8 +894,7 @@ bool AccessibleWrap::HandleLiveRegionEvent(AccEvent* aEvent) {
nsCOMPtr<nsIPersistentProperties> attributes = Attributes();
nsString live;
nsresult rv =
attributes->GetStringProperty(NS_LITERAL_CSTRING("container-live"), live);
nsresult rv = attributes->GetStringProperty("container-live"_ns, live);
if (!NS_SUCCEEDED(rv)) {
return false;
}
......@@ -908,8 +904,7 @@ bool AccessibleWrap::HandleLiveRegionEvent(AccEvent* aEvent) {
: nsIAccessibleAnnouncementEvent::POLITE;
nsString atomic;
rv = attributes->GetStringProperty(NS_LITERAL_CSTRING("container-atomic"),
atomic);
rv = attributes->GetStringProperty("container-atomic"_ns, atomic);
Accessible* announcementTarget = this;
nsAutoString announcement;
......
......@@ -82,7 +82,7 @@ void AccessibleNode::GetComputedRole(nsAString& aRole) {
void AccessibleNode::GetStates(nsTArray<nsString>& aStates) {
nsAccessibilityService* accService = GetOrCreateAccService();
if (!mIntl || !accService) {
aStates.AppendElement(NS_LITERAL_STRING("defunct"));
aStates.AppendElement(u"defunct"_ns);
return;
}
......
......@@ -315,11 +315,10 @@ dbus_done:
nsCOMPtr<nsIGSettingsCollection> a11y_settings;
if (gsettings) {
gsettings->GetCollectionForSchema(
NS_LITERAL_CSTRING(GSETINGS_A11Y_INTERFACE),
getter_AddRefs(a11y_settings));
gsettings->GetCollectionForSchema(nsLiteralCString(GSETINGS_A11Y_INTERFACE),
getter_AddRefs(a11y_settings));
if (a11y_settings) {
a11y_settings->GetBoolean(NS_LITERAL_CSTRING(GSETINGS_A11Y_KEY),
a11y_settings->GetBoolean(nsLiteralCString(GSETINGS_A11Y_KEY),
&sShouldEnable);
}
}
......
......@@ -1469,8 +1469,7 @@ bool AttrIterator::Next(nsAString& aAttrName, nsAString& aAttrValue) {
if (attr->NamespaceEquals(kNameSpaceID_None)) {
nsAtom* attrAtom = attr->Atom();
nsDependentAtomString attrStr(attrAtom);
if (!StringBeginsWith(attrStr, NS_LITERAL_STRING("aria-")))
continue; // Not ARIA
if (!StringBeginsWith(attrStr, u"aria-"_ns)) continue; // Not ARIA
uint8_t attrFlags = aria::AttrCharacteristicsFor(attrAtom);
if (attrFlags & ATTR_BYPASSOBJ)
......
......@@ -387,8 +387,7 @@ void DocManager::AddListeners(Document* aDocument,
nsPIDOMWindowOuter* window = aDocument->GetWindow();
EventTarget* target = window->GetChromeEventHandler();
EventListenerManager* elm = target->GetOrCreateListenerManager();
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
TrustedEventsAtCapture());
elm->AddEventListenerByType(this, u"pagehide"_ns, TrustedEventsAtCapture());
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocCreate))
......@@ -396,7 +395,7 @@ void DocManager::AddListeners(Document* aDocument,
#endif
if (aAddDOMContentLoadedListener) {
elm->AddEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
elm->AddEventListenerByType(this, u"DOMContentLoaded"_ns,
TrustedEventsAtCapture());
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocCreate))
......@@ -413,10 +412,10 @@ void DocManager::RemoveListeners(Document* aDocument) {
if (!target) return;
EventListenerManager* elm = target->GetOrCreateListenerManager();
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
elm->RemoveEventListenerByType(this, u"pagehide"_ns,
TrustedEventsAtCapture());
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
elm->RemoveEventListenerByType(this, u"DOMContentLoaded"_ns,
TrustedEventsAtCapture());
}
......
......@@ -80,8 +80,7 @@ MARKUPMAP(
nsAutoString displayValue;
StyleInfo styleInfo(aElement);
styleInfo.Display(displayValue);
if (displayValue != NS_LITERAL_STRING("block") &&
displayValue != NS_LITERAL_STRING("inline-block")) {
if (displayValue != u"block"_ns && displayValue != u"inline-block"_ns) {
return nullptr;
}
// Check for various conditions to determine if this is a block
......
......@@ -237,23 +237,19 @@ void TextAttrsMgr::InvalidTextAttr::ExposeValue(
nsIPersistentProperties* aAttributes, const uint32_t& aValue) {
switch (aValue) {
case eFalse:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid,
NS_LITERAL_STRING("false"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid, u"false"_ns);
break;
case eGrammar:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid,
NS_LITERAL_STRING("grammar"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid, u"grammar"_ns);
break;
case eSpelling:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid,
NS_LITERAL_STRING("spelling"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid, u"spelling"_ns);
break;
case eTrue:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid,
NS_LITERAL_STRING("true"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid, u"true"_ns);
break;
}
}
......@@ -592,9 +588,8 @@ bool TextAttrsMgr::AutoGeneratedTextAttr::GetValueFor(Accessible* aAccessible,
void TextAttrsMgr::AutoGeneratedTextAttr::ExposeValue(
nsIPersistentProperties* aAttributes, const bool& aValue) {
nsAccUtils::SetAccAttr(
aAttributes, nsGkAtoms::auto_generated,
aValue ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::auto_generated,
aValue ? u"true"_ns : u"false"_ns);
}
////////////////////////////////////////////////////////////////////////////////
......@@ -697,17 +692,15 @@ void TextAttrsMgr::TextPosTextAttr::ExposeValue(
switch (aValue) {
case eTextPosBaseline:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textPosition,
NS_LITERAL_STRING("baseline"));
u"baseline"_ns);
break;
case eTextPosSub:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textPosition,
NS_LITERAL_STRING("sub"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textPosition, u"sub"_ns);
break;
case eTextPosSuper:
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textPosition,
NS_LITERAL_STRING("super"));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textPosition, u"super"_ns);
break;
case eTextPosNone:
......
......@@ -38,7 +38,7 @@ XULMAP_TYPE(toolbarbutton, XULToolbarButtonAccessible)
XULMAP_TYPE(tooltip, XULTooltipAccessible)
XULMAP(label, [](Element* aElement, Accessible* aContext) -> Accessible* {
if (aElement->ClassList()->Contains(NS_LITERAL_STRING("text-link"))) {
if (aElement->ClassList()->Contains(u"text-link"_ns)) {
return new XULLinkAccessible(aElement, aContext->Document());
}
return new XULLabelAccessible(aElement, aContext->Document());
......
......@@ -161,8 +161,7 @@ void nsAccUtils::SetLiveContainerAttributes(
if (ancestor->IsElement() && ancestor->AsElement()->AttrValueIs(
kNameSpaceID_None, nsGkAtoms::aria_atomic,
nsGkAtoms::_true, eCaseMatters)) {
SetAccAttr(aAttributes, nsGkAtoms::containerAtomic,
NS_LITERAL_STRING("true"));
SetAccAttr(aAttributes, nsGkAtoms::containerAtomic, u"true"_ns);
}
// container-busy attribute
......@@ -357,10 +356,10 @@ nsIntPoint nsAccUtils::GetScreenCoordsForParent(Accessible* aAccessible) {
bool nsAccUtils::GetLiveAttrValue(uint32_t aRule, nsAString& aValue) {
switch (aRule) {
case eOffLiveAttr:
aValue = NS_LITERAL_STRING("off");
aValue = u"off"_ns;
return true;
case ePoliteLiveAttr:
aValue = NS_LITERAL_STRING("polite");
aValue = u"polite"_ns;
return true;
}
......
......@@ -123,8 +123,7 @@ static bool MustBeAccessible(nsIContent* aContent, DocAccessible* aDocument) {
}
nsDependentAtomString attrStr(attrAtom);
if (!StringBeginsWith(attrStr, NS_LITERAL_STRING("aria-")))
continue; // not ARIA
if (!StringBeginsWith(attrStr, u"aria-"_ns)) continue; // not ARIA
// A global state or a property and in case of token defined.
uint8_t attrFlags = aria::AttrCharacteristicsFor(attrAtom);
......@@ -702,7 +701,7 @@ void nsAccessibilityService::GetStringStates(uint32_t aState,
// unknown state
if (!stringStates->Length()) {
stringStates->Add(NS_LITERAL_STRING("unknown"));
stringStates->Add(u"unknown"_ns);
}
stringStates.forget(aStringStates);
......@@ -713,148 +712,148 @@ already_AddRefed<DOMStringList> nsAccessibilityService::GetStringStates(
RefPtr<DOMStringList> stringStates = new DOMStringList();
if (aStates & states::UNAVAILABLE) {
stringStates->Add(NS_LITERAL_STRING("unavailable"));
stringStates->Add(u"unavailable"_ns);
}
if (aStates & states::SELECTED) {
stringStates->Add(NS_LITERAL_STRING("selected"));
stringStates->Add(u"selected"_ns);
}
if (aStates & states::FOCUSED) {
stringStates->Add(NS_LITERAL_STRING("focused"));
stringStates->Add(u"focused"_ns);
}
if (aStates & states::PRESSED) {
stringStates->Add(NS_LITERAL_STRING("pressed"));
stringStates->Add(u"pressed"_ns);
}
if (aStates & states::CHECKED) {
stringStates->Add(NS_LITERAL_STRING("checked"));
stringStates->Add(u"checked"_ns);
}
if (aStates & states::MIXED) {
stringStates->Add(NS_LITERAL_STRING("mixed"));
stringStates->Add(u"mixed"_ns);
}
if (aStates & states::READONLY) {
stringStates->Add(NS_LITERAL_STRING("readonly"));
stringStates->Add(u"readonly"_ns);
}
if (aStates & states::HOTTRACKED) {
stringStates->Add(NS_LITERAL_STRING("hottracked"));
stringStates->Add(u"hottracked"_ns);
}
if (aStates & states::DEFAULT) {
stringStates->Add(NS_LITERAL_STRING("default"));
stringStates->Add(u"default"_ns);
}
if (aStates & states::EXPANDED) {
stringStates->Add(NS_LITERAL_STRING("expanded"));
stringStates->Add(u"expanded"_ns);
}
if (aStates & states::COLLAPSED) {
stringStates->Add(NS_LITERAL_STRING("collapsed"));
stringStates->Add(u"collapsed"_ns);
}
if (aStates & states::BUSY) {
stringStates->Add(NS_LITERAL_STRING("busy"));
stringStates->Add(u"busy"_ns);
}
if (aStates & states::FLOATING) {
stringStates->Add(NS_LITERAL_STRING("floating"));
stringStates->Add(u"floating"_ns);
}
if (aStates & states::ANIMATED) {
stringStates->Add(NS_LITERAL_STRING("animated"));
stringStates->Add(u"animated"_ns);
}
if (aStates & states::INVISIBLE) {
stringStates->Add(NS_LITERAL_STRING("invisible"));
stringStates->Add(u"invisible"_ns);
}
if (aStates & states::OFFSCREEN) {
stringStates->Add(NS_LITERAL_STRING("offscreen"));
stringStates->Add(u"offscreen"_ns);
}
if (aStates & states::SIZEABLE) {
stringStates->Add(NS_LITERAL_STRING("sizeable"));
stringStates->Add(u"sizeable"_ns);
}
if (aStates & states::MOVEABLE) {
stringStates->Add(NS_LITERAL_STRING("moveable"));
stringStates->Add(u"moveable"_ns);
}
if (aStates & states::SELFVOICING) {
stringStates->Add(NS_LITERAL_STRING("selfvoicing"));
stringStates->Add(u"selfvoicing"_ns);
}
if (aStates & states::FOCUSABLE) {
stringStates->Add(NS_LITERAL_STRING("focusable"));
stringStates->Add(u"focusable"_ns);
}
if (aStates & states::SELECTABLE) {
stringStates->Add(NS_LITERAL_STRING("selectable"));
stringStates->Add(u"selectable"_ns);
}
if (aStates & states::LINKED) {
stringStates->Add(NS_LITERAL_STRING("linked"));
stringStates->Add(u"linked"_ns);
}
if (aStates & states::TRAVERSED) {
stringStates->Add(NS_LITERAL_STRING("traversed"));
stringStates->Add(u"traversed"_ns);
}
if (aStates & states::MULTISELECTABLE) {
stringStates->Add(NS_LITERAL_STRING("multiselectable"));
stringStates->Add(u"multiselectable"_ns);
}
if (aStates & states::EXTSELECTABLE) {
stringStates->Add(NS_LITERAL_STRING("extselectable"));
stringStates->Add(u"extselectable"_ns);
}
if (aStates & states::PROTECTED) {
stringStates->Add(NS_LITERAL_STRING("protected"));
stringStates->Add(u"protected"_ns);
}
if (aStates & states::HASPOPUP) {
stringStates->Add(NS_LITERAL_STRING("haspopup"));
stringStates->Add(u"haspopup"_ns);
}
if (aStates & states::REQUIRED) {
stringStates->Add(NS_LITERAL_STRING("required"));
stringStates->Add(u"required"_ns);
}
if (aStates & states::ALERT) {
stringStates->Add(NS_LITERAL_STRING("alert"));
stringStates->Add(u"alert"_ns);
}
if (aStates & states::INVALID) {
stringStates->Add(NS_LITERAL_STRING("invalid"));
stringStates->Add(u"invalid"_ns);
}
if (aStates & states::CHECKABLE) {
stringStates->Add(NS_LITERAL_STRING("checkable"));
stringStates->Add(u"checkable"_ns);
}
if (aStates & states::SUPPORTS_AUTOCOMPLETION) {
stringStates->Add(NS_LITERAL_STRING("autocompletion"));
stringStates->Add(u"autocompletion"_ns);
}
if (aStates & states::DEFUNCT) {
stringStates->Add(NS_LITERAL_STRING("defunct"));
stringStates->Add(u"defunct"_ns);
}
if (aStates & states::SELECTABLE_TEXT) {
stringStates->Add(NS_LITERAL_STRING("selectable text"));
stringStates->Add(u"selectable text"_ns);
}
if (aStates & states::EDITABLE) {
stringStates->Add(NS_LITERAL_STRING("editable"));
stringStates->Add(u"editable"_ns);
}
if (aStates & states::ACTIVE) {
stringStates->Add(NS_LITERAL_STRING("active"));
stringStates->Add(u"active"_ns);
}
if (aStates & states::MODAL) {
stringStates->Add(NS_LITERAL_STRING("modal"));
stringStates->Add(u"modal"_ns);
}
if (aStates & states::MULTI_LINE) {
stringStates->Add(NS_LITERAL_STRING("multi line"));
stringStates->Add(u"multi line"_ns);
}
if (aStates & states::HORIZONTAL) {
stringStates->Add(NS_LITERAL_STRING("horizontal"));
stringStates->Add(u"horizontal"_ns);
}
if (aStates & states::OPAQUE1) {
stringStates->Add(NS_LITERAL_STRING("opaque"));
stringStates->Add(u"opaque"_ns);
}
if (aStates & states::SINGLE_LINE) {
stringStates->Add(NS_LITERAL_STRING("single line"));
stringStates->Add(u"single line"_ns);
}
if (aStates & states::TRANSIENT) {
stringStates->Add(NS_LITERAL_STRING("transient"));
stringStates->Add(u"transient"_ns);
}
if (aStates & states::VERTICAL) {
stringStates->Add(NS_LITERAL_STRING("vertical"));
stringStates->Add(u"vertical"_ns);
}
if (aStates & states::STALE) {
stringStates->Add(NS_LITERAL_STRING("stale"));
stringStates->Add(u"stale"_ns);
}
if (aStates & states::ENABLED) {
stringStates->Add(NS_LITERAL_STRING("enabled"));
stringStates->Add(u"enabled"_ns);
}
if (aStates & states::SENSITIVE) {
stringStates->Add(NS_LITERAL_STRING("sensitive"));
stringStates->Add(u"sensitive"_ns);
}
if (aStates & states::PINNED) {
stringStates->Add(NS_LITERAL_STRING("pinned"));
stringStates->Add(u"pinned"_ns);
}
if (aStates & states::CURRENT) {
stringStates->Add(NS_LITERAL_STRING("current"));
stringStates->Add(u"current"_ns);
}
return stringStates.forget();
......@@ -1280,7 +1279,7 @@ bool nsAccessibilityService::Init() {
gApplicationAccessible->Init();
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::Accessibility,
NS_LITERAL_CSTRING("Active"));
"Active"_ns);
#ifdef XP_WIN
sPendingPlugins = new nsTArray<nsCOMPtr<nsIContent> >;
......
......@@ -61,8 +61,7 @@ void nsEventShell::GetEventAttributes(nsINode* aNode,
if (aNode != sEventTargetNode) return;
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::eventFromInput,
sEventFromUserInput ? NS_LITERAL_STRING("true")
: NS_LITERAL_STRING("false"));
sEventFromUserInput ? u"true"_ns : u"false"_ns);
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -42,8 +42,7 @@ ARIAGridAccessible::NativeAttributes() {
if (IsProbablyLayoutTable()) {
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("layout-guess"),
NS_LITERAL_STRING("true"), unused);
attributes->SetStringProperty("layout-guess"_ns, u"true"_ns, unused);
}
return attributes.forget();
......@@ -385,13 +384,11 @@ nsresult ARIAGridAccessible::SetARIASelected(Accessible* aAccessible,
nsresult rv = NS_OK;
if (content->IsElement()) {
if (aIsSelected)
rv = content->AsElement()->SetAttr(kNameSpaceID_None,
nsGkAtoms::aria_selected,
NS_LITERAL_STRING("true"), aNotify);
rv = content->AsElement()->SetAttr(
kNameSpaceID_None, nsGkAtoms::aria_selected, u"true"_ns, aNotify);
else
rv = content->AsElement()->SetAttr(kNameSpaceID_None,
nsGkAtoms::aria_selected,
NS_LITERAL_STRING("false"), aNotify);
rv = content->AsElement()->SetAttr(
kNameSpaceID_None, nsGkAtoms::aria_selected, u"false"_ns, aNotify);
}
NS_ENSURE_SUCCESS(rv, rv);
......@@ -608,8 +605,7 @@ ARIAGridCellAccessible::NativeAttributes() {
#ifdef DEBUG
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("cppclass"),
NS_LITERAL_STRING("ARIAGridCellAccessible"),
attributes->SetStringProperty("cppclass"_ns, u"ARIAGridCellAccessible"_ns,
unused);
#endif
......
......@@ -675,9 +675,8 @@ void Accessible::SetSelected(bool aSelect) {
if (select->State() & states::MULTISELECTABLE) {
if (mContent->IsElement() && ARIARoleMap()) {
if (aSelect) {
mContent->AsElement()->SetAttr(kNameSpaceID_None,
nsGkAtoms::aria_selected,
NS_LITERAL_STRING("true"), true);
mContent->AsElement()->SetAttr(
kNameSpaceID_None, nsGkAtoms::aria_selected, u"true"_ns, true);
} else {
mContent->AsElement()->UnsetAttr(kNameSpaceID_None,
nsGkAtoms::aria_selected, true);
......@@ -957,7 +956,7 @@ already_AddRefed<nsIPersistentProperties> Accessible::Attributes() {
if (roleMapEntry) {
if (roleMapEntry->Is(nsGkAtoms::searchbox)) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::textInputType,
NS_LITERAL_STRING("search"));
u"search"_ns);
}
nsAutoString live;
......@@ -983,21 +982,18 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
if (HasNumericValue()) {
nsAutoString valuetext;
Value(valuetext);
attributes->SetStringProperty(NS_LITERAL_CSTRING("valuetext"), valuetext,
unused);
attributes->SetStringProperty("valuetext"_ns, valuetext, unused);
}
// Expose checkable object attribute if the accessible has checkable state
if (State() & states::CHECKABLE) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::checkable,
NS_LITERAL_STRING("true"));
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::checkable, u"true"_ns);
}
// Expose 'explicit-name' attribute.
nsAutoString name;
if (Name(name) != eNameFromSubtree && !name.IsVoid()) {
attributes->SetStringProperty(NS_LITERAL_CSTRING("explicit-name"),
NS_LITERAL_STRING("true"), unused);
attributes->SetStringProperty("explicit-name"_ns, u"true"_ns, unused);
}
// Group attributes (level/setsize/posinset)
......@@ -1010,13 +1006,11 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
if (itemCount) {
nsAutoString itemCountStr;
itemCountStr.AppendInt(itemCount);
attributes->SetStringProperty(NS_LITERAL_CSTRING("child-item-count"),
itemCountStr, unused);
attributes->SetStringProperty("child-item-count"_ns, itemCountStr, unused);
}
if (hierarchical) {
attributes->SetStringProperty(NS_LITERAL_CSTRING("hierarchical"),
NS_LITERAL_STRING("true"), unused);
attributes->SetStringProperty("hierarchical"_ns, u"true"_ns, unused);
}
// If the accessible doesn't have own content (such as list item bullet or
......@@ -1035,7 +1029,7 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
nsAutoString id;
if (nsCoreUtils::GetID(mContent, id))
attributes->SetStringProperty(NS_LITERAL_CSTRING("id"), id, unused);
attributes->SetStringProperty("id"_ns, id, unused);
// Expose class because it may have useful microformat information.
nsAutoString _class;
......@@ -1051,8 +1045,7 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
// Expose draggable object attribute.
if (auto htmlElement = nsGenericHTMLElement::FromNode(mContent)) {
if (htmlElement->Draggable()) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::draggable,