зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1694853 - Replace outdated 'in' prefix with the more common 'a' prefix. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D106372
This commit is contained in:
Родитель
bef1b64ba1
Коммит
aadabba66f
|
@ -62,7 +62,7 @@ class nsMenuItemX final : public nsMenuObjectX, public nsChangeObserver {
|
||||||
void SetupIcon();
|
void SetupIcon();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void UncheckRadioSiblings(nsIContent* inCheckedElement);
|
void UncheckRadioSiblings(nsIContent* aCheckedElement);
|
||||||
void SetKeyEquiv();
|
void SetKeyEquiv();
|
||||||
|
|
||||||
EMenuItemType mType;
|
EMenuItemType mType;
|
||||||
|
|
|
@ -180,16 +180,16 @@ nsresult nsMenuItemX::DispatchDOMEvent(const nsString& eventName, bool* preventD
|
||||||
|
|
||||||
// Walk the sibling list looking for nodes with the same name and
|
// Walk the sibling list looking for nodes with the same name and
|
||||||
// uncheck them all.
|
// uncheck them all.
|
||||||
void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent) {
|
void nsMenuItemX::UncheckRadioSiblings(nsIContent* aCheckedContent) {
|
||||||
nsAutoString myGroupName;
|
nsAutoString myGroupName;
|
||||||
if (inCheckedContent->IsElement()) {
|
if (aCheckedContent->IsElement()) {
|
||||||
inCheckedContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, myGroupName);
|
aCheckedContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, myGroupName);
|
||||||
}
|
}
|
||||||
if (!myGroupName.Length()) { // no groupname, nothing to do
|
if (!myGroupName.Length()) { // no groupname, nothing to do
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> parent = inCheckedContent->GetParent();
|
nsCOMPtr<nsIContent> parent = aCheckedContent->GetParent();
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent) {
|
||||||
// loop over siblings
|
// loop over siblings
|
||||||
for (nsIContent* sibling = parent->GetFirstChild(); sibling;
|
for (nsIContent* sibling = parent->GetFirstChild(); sibling;
|
||||||
sibling = sibling->GetNextSibling()) {
|
sibling = sibling->GetNextSibling()) {
|
||||||
if (sibling != inCheckedContent && sibling->IsElement()) { // skip this node
|
if (sibling != aCheckedContent && sibling->IsElement()) { // skip this node
|
||||||
// if the current sibling is in the same group, clear it
|
// if the current sibling is in the same group, clear it
|
||||||
if (sibling->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, myGroupName,
|
if (sibling->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, myGroupName,
|
||||||
eCaseMatters)) {
|
eCaseMatters)) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ uint8_t GeckoModifiersForNodeAttribute(const nsString& modifiersAttribute);
|
||||||
unsigned int MacModifiersForGeckoModifiers(uint8_t geckoModifiers);
|
unsigned int MacModifiersForGeckoModifiers(uint8_t geckoModifiers);
|
||||||
nsMenuBarX* GetHiddenWindowMenuBar(); // returned object is not retained
|
nsMenuBarX* GetHiddenWindowMenuBar(); // returned object is not retained
|
||||||
NSMenuItem* GetStandardEditMenuItem(); // returned object is not retained
|
NSMenuItem* GetStandardEditMenuItem(); // returned object is not retained
|
||||||
bool NodeIsHiddenOrCollapsed(nsIContent* inContent);
|
bool NodeIsHiddenOrCollapsed(nsIContent* aContent);
|
||||||
int CalculateNativeInsertionPoint(nsMenuObjectX* aParent, nsMenuObjectX* aChild);
|
int CalculateNativeInsertionPoint(nsMenuObjectX* aParent, nsMenuObjectX* aChild);
|
||||||
|
|
||||||
// Find the menu item by following the path aLocationString from aRootMenu.
|
// Find the menu item by following the path aLocationString from aRootMenu.
|
||||||
|
|
|
@ -179,11 +179,11 @@ NSMenuItem* nsMenuUtilsX::GetStandardEditMenuItem() {
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* inContent) {
|
bool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* aContent) {
|
||||||
return inContent->IsElement() &&
|
return aContent->IsElement() &&
|
||||||
(inContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
|
(aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true,
|
||||||
nsGkAtoms::_true, eCaseMatters) ||
|
eCaseMatters) ||
|
||||||
inContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::collapsed,
|
aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::collapsed,
|
||||||
nsGkAtoms::_true, eCaseMatters));
|
nsGkAtoms::_true, eCaseMatters));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,9 +73,9 @@ class nsMenuX final : public nsMenuObjectX, public nsChangeObserver {
|
||||||
bool OnClose();
|
bool OnClose();
|
||||||
void AddMenuItem(mozilla::UniquePtr<nsMenuItemX>&& aMenuItem);
|
void AddMenuItem(mozilla::UniquePtr<nsMenuItemX>&& aMenuItem);
|
||||||
void AddMenu(mozilla::UniquePtr<nsMenuX>&& aMenu);
|
void AddMenu(mozilla::UniquePtr<nsMenuX>&& aMenu);
|
||||||
void LoadMenuItem(nsIContent* inMenuItemContent);
|
void LoadMenuItem(nsIContent* aMenuItemContent);
|
||||||
void LoadSubMenu(nsIContent* inMenuContent);
|
void LoadSubMenu(nsIContent* aMenuContent);
|
||||||
GeckoNSMenu* CreateMenuWithGeckoString(nsString& menuTitle);
|
GeckoNSMenu* CreateMenuWithGeckoString(nsString& aMenuTitle);
|
||||||
|
|
||||||
nsTArray<mozilla::UniquePtr<nsMenuObjectX>> mMenuObjectsArray;
|
nsTArray<mozilla::UniquePtr<nsMenuObjectX>> mMenuObjectsArray;
|
||||||
nsString mLabel;
|
nsString mLabel;
|
||||||
|
|
|
@ -435,11 +435,11 @@ nsresult nsMenuX::GetEnabled(bool* aIsEnabled) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& menuTitle) {
|
GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& aMenuTitle) {
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||||
|
|
||||||
NSString* title = [NSString stringWithCharacters:(UniChar*)menuTitle.get()
|
NSString* title = [NSString stringWithCharacters:(UniChar*)aMenuTitle.get()
|
||||||
length:menuTitle.Length()];
|
length:aMenuTitle.Length()];
|
||||||
GeckoNSMenu* myMenu = [[GeckoNSMenu alloc] initWithTitle:title];
|
GeckoNSMenu* myMenu = [[GeckoNSMenu alloc] initWithTitle:title];
|
||||||
myMenu.delegate = mMenuDelegate;
|
myMenu.delegate = mMenuDelegate;
|
||||||
|
|
||||||
|
@ -457,24 +457,24 @@ GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& menuTitle) {
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent) {
|
void nsMenuX::LoadMenuItem(nsIContent* aMenuItemContent) {
|
||||||
if (!inMenuItemContent) {
|
if (!aMenuItemContent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoString menuitemName;
|
nsAutoString menuitemName;
|
||||||
if (inMenuItemContent->IsElement()) {
|
if (aMenuItemContent->IsElement()) {
|
||||||
inMenuItemContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, menuitemName);
|
aMenuItemContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, menuitemName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("menuitem %s \n", NS_LossyConvertUTF16toASCII(menuitemName).get());
|
// printf("menuitem %s \n", NS_LossyConvertUTF16toASCII(menuitemName).get());
|
||||||
|
|
||||||
EMenuItemType itemType = eRegularMenuItemType;
|
EMenuItemType itemType = eRegularMenuItemType;
|
||||||
if (inMenuItemContent->IsXULElement(nsGkAtoms::menuseparator)) {
|
if (aMenuItemContent->IsXULElement(nsGkAtoms::menuseparator)) {
|
||||||
itemType = eSeparatorMenuItemType;
|
itemType = eSeparatorMenuItemType;
|
||||||
} else if (inMenuItemContent->IsElement()) {
|
} else if (aMenuItemContent->IsElement()) {
|
||||||
static Element::AttrValuesArray strings[] = {nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr};
|
static Element::AttrValuesArray strings[] = {nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr};
|
||||||
switch (inMenuItemContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
|
switch (aMenuItemContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
|
||||||
strings, eCaseMatters)) {
|
strings, eCaseMatters)) {
|
||||||
case 0:
|
case 0:
|
||||||
itemType = eCheckboxMenuItemType;
|
itemType = eCheckboxMenuItemType;
|
||||||
|
@ -486,11 +486,11 @@ void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AddMenuItem(
|
AddMenuItem(
|
||||||
MakeUnique<nsMenuItemX>(this, menuitemName, itemType, mMenuGroupOwner, inMenuItemContent));
|
MakeUnique<nsMenuItemX>(this, menuitemName, itemType, mMenuGroupOwner, aMenuItemContent));
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsMenuX::LoadSubMenu(nsIContent* inMenuContent) {
|
void nsMenuX::LoadSubMenu(nsIContent* aMenuContent) {
|
||||||
AddMenu(MakeUnique<nsMenuX>(this, mMenuGroupOwner, inMenuContent));
|
AddMenu(MakeUnique<nsMenuX>(this, mMenuGroupOwner, aMenuContent));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This menu is about to open. Returns TRUE if we should keep processing the event,
|
// This menu is about to open. Returns TRUE if we should keep processing the event,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче