diff --git a/accessible/src/base/Logging.cpp b/accessible/src/base/Logging.cpp index 70212f0e3fe5..57c6806eb696 100644 --- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -162,13 +162,17 @@ LogDocState(nsIDocument* aDocumentNode) printf(", %sshowing", aDocumentNode->IsShowing() ? "" : "not "); printf(", %svisible", aDocumentNode->IsVisible() ? "" : "not "); printf(", %sactive", aDocumentNode->IsActive() ? "" : "not "); + printf(", %sresource", aDocumentNode->IsResourceDoc() ? "" : "not "); + printf(", has %srole content", + nsCoreUtils::GetRoleContent(aDocumentNode) ? "" : "no "); } static void LogPresShell(nsIDocument* aDocumentNode) { nsIPresShell* ps = aDocumentNode->GetShell(); - printf("presshell: %p", static_cast(ps)); + printf("presshell: %p, is %s destroying", static_cast(ps), + (ps->IsDestroying() ? "" : "not")); nsIScrollableFrame *sf = ps ? ps->GetRootScrollFrameAsScrollableExternal() : nullptr; printf(", root scroll frame: %p", static_cast(sf)); @@ -531,7 +535,7 @@ logging::FocusNotificationTarget(const char* aMsg, const char* aTargetDescr, if (aTargetThing) { nsCOMPtr targetNode(do_QueryInterface(aTargetThing)); if (targetNode) - Node(aTargetDescr, targetNode); + AccessibleNNode(aTargetDescr, targetNode); else printf(" %s: %p, window\n", aTargetDescr, static_cast(aTargetThing)); @@ -709,6 +713,18 @@ logging::Node(const char* aDescr, nsINode* aNode) aDescr, static_cast(elm), tag.get(), id.get(), idxInParent); } +void +logging::Document(DocAccessible* aDocument) +{ + printf(" Document: %p, document node: %p\n", + static_cast(aDocument), + static_cast(aDocument->GetDocumentNode())); + + printf(" Document "); + LogDocURI(aDocument->GetDocumentNode()); + printf("\n"); +} + void logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible) { @@ -728,13 +744,7 @@ logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible) nodeDescr.AppendLiteral(" node"); Node(nodeDescr.get(), aAccessible->GetNode()); - printf(" Document: %p, document node: %p\n", - static_cast(aAccessible->Document()), - static_cast(aAccessible->GetDocumentNode())); - - printf(" Document "); - LogDocURI(static_cast(aAccessible->GetDocumentNode())); - printf("\n"); + Document(aAccessible->Document()); } void @@ -751,9 +761,18 @@ logging::AccessibleNNode(const char* aDescr, nsINode* aNode) } } - nsAutoCString nodeDescr("Not accessible "); + nsAutoCString nodeDescr("[not accessible] "); nodeDescr.Append(aDescr); Node(nodeDescr.get(), aNode); + + if (document) { + Document(document); + return; + } + + printf(" [contained by not accessible document]:\n"); + LogDocInfo(aNode->OwnerDoc(), document); + printf("\n"); } void diff --git a/accessible/src/base/Logging.h b/accessible/src/base/Logging.h index 631ec34046e7..a67922141650 100644 --- a/accessible/src/base/Logging.h +++ b/accessible/src/base/Logging.h @@ -150,6 +150,11 @@ void Address(const char* aDescr, Accessible* aAcc); */ void Node(const char* aDescr, nsINode* aNode); +/** + * Log the document accessible info as message entry. + */ +void Document(DocAccessible* aDocument); + /** * Log the accessible and its DOM node as a message entry. */