зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1698668
- Add (unused) Dump methods to nsMenuX and nsMenuItemX that can be used during debugging. r=harry
Depends on D108550 Differential Revision: https://phabricator.services.mozilla.com/D108551
This commit is contained in:
Родитель
d30b9410c6
Коммит
f84ecc96c9
|
@ -63,6 +63,8 @@ class nsMenuItemX final : public nsMenuObjectX, public nsChangeObserver {
|
|||
nsIContent* Content() { return mContent; }
|
||||
NSMenuItem* NativeNSMenuItem() { return mNativeMenuItem; }
|
||||
|
||||
void Dump(uint32_t aIndent) const;
|
||||
|
||||
protected:
|
||||
void UncheckRadioSiblings(nsIContent* aCheckedElement);
|
||||
void SetKeyEquiv();
|
||||
|
|
|
@ -257,6 +257,12 @@ void nsMenuItemX::SetKeyEquiv() {
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
void nsMenuItemX::Dump(uint32_t aIndent) const {
|
||||
printf("%*s - item [%p] %-16s <%s>\n", aIndent * 2, "", this,
|
||||
mType == eSeparatorMenuItemType ? "----" : [mNativeMenuItem.title UTF8String],
|
||||
NS_ConvertUTF16toUTF8(mContent->NodeName()).get());
|
||||
}
|
||||
|
||||
//
|
||||
// nsChangeObserver
|
||||
//
|
||||
|
|
|
@ -67,6 +67,8 @@ class nsMenuX final : public nsMenuObjectX, public nsChangeObserver {
|
|||
NSMenuItem* NativeNSMenuItem() { return mNativeMenuItem; }
|
||||
GeckoNSMenu* NativeNSMenu() { return mNativeMenu; }
|
||||
|
||||
void Dump(uint32_t aIndent) const;
|
||||
|
||||
static bool IsXULHelpMenu(nsIContent* aMenuContent);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -692,6 +692,33 @@ void nsMenuX::IconUpdated() {
|
|||
mParent->IconUpdated();
|
||||
}
|
||||
|
||||
void nsMenuX::Dump(uint32_t aIndent) const {
|
||||
printf("%*s - menu [%p] %-16s <%s>", aIndent * 2, "", this,
|
||||
mLabel.IsEmpty() ? "(empty label)" : NS_ConvertUTF16toUTF8(mLabel).get(),
|
||||
NS_ConvertUTF16toUTF8(mContent->NodeName()).get());
|
||||
if (mNeedsRebuild) {
|
||||
printf(" [NeedsRebuild]");
|
||||
}
|
||||
if (mConstructed) {
|
||||
printf(" [Constructed]");
|
||||
}
|
||||
if (mVisible) {
|
||||
printf(" [Visible]");
|
||||
}
|
||||
if (mIsEnabled) {
|
||||
printf(" [IsEnabled]");
|
||||
}
|
||||
printf(" (%d visible items)", int(mVisibleItemsCount));
|
||||
printf("\n");
|
||||
for (const auto& subitem : mMenuObjectsArray) {
|
||||
if (subitem->MenuObjectType() == eSubmenuObjectType) {
|
||||
static_cast<nsMenuX*>(subitem.get())->Dump(aIndent + 1);
|
||||
} else if (subitem->MenuObjectType() == eMenuItemObjectType) {
|
||||
static_cast<nsMenuItemX*>(subitem.get())->Dump(aIndent + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// MenuDelegate Objective-C class, used to set up Carbon events
|
||||
//
|
||||
|
|
Загрузка…
Ссылка в новой задаче