зеркало из 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:
Родитель
de9c44a290
Коммит
f09a47916b
|
@ -62,7 +62,7 @@ class nsMenuItemX final : public nsMenuObjectX, public nsChangeObserver {
|
|||
void SetupIcon();
|
||||
|
||||
protected:
|
||||
void UncheckRadioSiblings(nsIContent* inCheckedElement);
|
||||
void UncheckRadioSiblings(nsIContent* aCheckedElement);
|
||||
void SetKeyEquiv();
|
||||
|
||||
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
|
||||
// uncheck them all.
|
||||
void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent) {
|
||||
void nsMenuItemX::UncheckRadioSiblings(nsIContent* aCheckedContent) {
|
||||
nsAutoString myGroupName;
|
||||
if (inCheckedContent->IsElement()) {
|
||||
inCheckedContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, myGroupName);
|
||||
if (aCheckedContent->IsElement()) {
|
||||
aCheckedContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, myGroupName);
|
||||
}
|
||||
if (!myGroupName.Length()) { // no groupname, nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> parent = inCheckedContent->GetParent();
|
||||
nsCOMPtr<nsIContent> parent = aCheckedContent->GetParent();
|
||||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent) {
|
|||
// loop over siblings
|
||||
for (nsIContent* sibling = parent->GetFirstChild(); sibling;
|
||||
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 (sibling->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, myGroupName,
|
||||
eCaseMatters)) {
|
||||
|
|
|
@ -23,7 +23,7 @@ uint8_t GeckoModifiersForNodeAttribute(const nsString& modifiersAttribute);
|
|||
unsigned int MacModifiersForGeckoModifiers(uint8_t geckoModifiers);
|
||||
nsMenuBarX* GetHiddenWindowMenuBar(); // 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);
|
||||
|
||||
// Find the menu item by following the path aLocationString from aRootMenu.
|
||||
|
|
|
@ -179,12 +179,12 @@ NSMenuItem* nsMenuUtilsX::GetStandardEditMenuItem() {
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
bool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* inContent) {
|
||||
return inContent->IsElement() &&
|
||||
(inContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
|
||||
nsGkAtoms::_true, eCaseMatters) ||
|
||||
inContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::collapsed,
|
||||
nsGkAtoms::_true, eCaseMatters));
|
||||
bool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* aContent) {
|
||||
return aContent->IsElement() &&
|
||||
(aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true,
|
||||
eCaseMatters) ||
|
||||
aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::collapsed,
|
||||
nsGkAtoms::_true, eCaseMatters));
|
||||
}
|
||||
|
||||
// Determines how many items are visible among the siblings in a menu that are
|
||||
|
|
|
@ -73,9 +73,9 @@ class nsMenuX final : public nsMenuObjectX, public nsChangeObserver {
|
|||
bool OnClose();
|
||||
void AddMenuItem(mozilla::UniquePtr<nsMenuItemX>&& aMenuItem);
|
||||
void AddMenu(mozilla::UniquePtr<nsMenuX>&& aMenu);
|
||||
void LoadMenuItem(nsIContent* inMenuItemContent);
|
||||
void LoadSubMenu(nsIContent* inMenuContent);
|
||||
GeckoNSMenu* CreateMenuWithGeckoString(nsString& menuTitle);
|
||||
void LoadMenuItem(nsIContent* aMenuItemContent);
|
||||
void LoadSubMenu(nsIContent* aMenuContent);
|
||||
GeckoNSMenu* CreateMenuWithGeckoString(nsString& aMenuTitle);
|
||||
|
||||
nsTArray<mozilla::UniquePtr<nsMenuObjectX>> mMenuObjectsArray;
|
||||
nsString mLabel;
|
||||
|
|
|
@ -435,11 +435,11 @@ nsresult nsMenuX::GetEnabled(bool* aIsEnabled) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& menuTitle) {
|
||||
GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& aMenuTitle) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
NSString* title = [NSString stringWithCharacters:(UniChar*)menuTitle.get()
|
||||
length:menuTitle.Length()];
|
||||
NSString* title = [NSString stringWithCharacters:(UniChar*)aMenuTitle.get()
|
||||
length:aMenuTitle.Length()];
|
||||
GeckoNSMenu* myMenu = [[GeckoNSMenu alloc] initWithTitle:title];
|
||||
myMenu.delegate = mMenuDelegate;
|
||||
|
||||
|
@ -457,25 +457,25 @@ GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& menuTitle) {
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent) {
|
||||
if (!inMenuItemContent) {
|
||||
void nsMenuX::LoadMenuItem(nsIContent* aMenuItemContent) {
|
||||
if (!aMenuItemContent) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoString menuitemName;
|
||||
if (inMenuItemContent->IsElement()) {
|
||||
inMenuItemContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, menuitemName);
|
||||
if (aMenuItemContent->IsElement()) {
|
||||
aMenuItemContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, menuitemName);
|
||||
}
|
||||
|
||||
// printf("menuitem %s \n", NS_LossyConvertUTF16toASCII(menuitemName).get());
|
||||
|
||||
EMenuItemType itemType = eRegularMenuItemType;
|
||||
if (inMenuItemContent->IsXULElement(nsGkAtoms::menuseparator)) {
|
||||
if (aMenuItemContent->IsXULElement(nsGkAtoms::menuseparator)) {
|
||||
itemType = eSeparatorMenuItemType;
|
||||
} else if (inMenuItemContent->IsElement()) {
|
||||
} else if (aMenuItemContent->IsElement()) {
|
||||
static Element::AttrValuesArray strings[] = {nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr};
|
||||
switch (inMenuItemContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
|
||||
strings, eCaseMatters)) {
|
||||
switch (aMenuItemContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
|
||||
strings, eCaseMatters)) {
|
||||
case 0:
|
||||
itemType = eCheckboxMenuItemType;
|
||||
break;
|
||||
|
@ -486,11 +486,11 @@ void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent) {
|
|||
}
|
||||
|
||||
AddMenuItem(
|
||||
MakeUnique<nsMenuItemX>(this, menuitemName, itemType, mMenuGroupOwner, inMenuItemContent));
|
||||
MakeUnique<nsMenuItemX>(this, menuitemName, itemType, mMenuGroupOwner, aMenuItemContent));
|
||||
}
|
||||
|
||||
void nsMenuX::LoadSubMenu(nsIContent* inMenuContent) {
|
||||
AddMenu(MakeUnique<nsMenuX>(this, mMenuGroupOwner, inMenuContent));
|
||||
void nsMenuX::LoadSubMenu(nsIContent* aMenuContent) {
|
||||
AddMenu(MakeUnique<nsMenuX>(this, mMenuGroupOwner, aMenuContent));
|
||||
}
|
||||
|
||||
// This menu is about to open. Returns TRUE if we should keep processing the event,
|
||||
|
|
Загрузка…
Ссылка в новой задаче