AX: Add the ability to dump the accessibility tree via notifyutil#47299
Conversation
|
EWS run on previous version of this PR (hash 19c7c72) Details |
There was a problem hiding this comment.
How about dumpAccessibilityTreeToStderr or something more specific? Show makes it sound like it will be visual
There was a problem hiding this comment.
Yeah agreed. The reason I chose this name is to follow the pattern of the other notifyutil tree dump functions, e.g.:
But I don't think we really need to follow the pattern in this case, so I'll change it.
There was a problem hiding this comment.
Does WTFLogAlways do the same as fprintf to stderr, with the same buffering and everything? I think it'd be best if all of the code that logs uses the same mechanism
There was a problem hiding this comment.
WTFLogAlways is a thin-wrapper over this:
// Assertions.cpp
void WTFLogAlwaysV(const char* format, va_list args)
{
vprintf_stderr_with_trailing_newline(nullptr, format, args);
}So seems like it's always stderr?
I mostly chose WTFLogAlways to follow the pattern of the several other similar "dump tree" methods, e.g.:
printLayerTreeForLiveDocuments
printRenderTreeForLiveDocuments
printPaintOrderTreeForLiveDocuments
...and a few others
Would you prefer we explicitly fprintf(stderr, ""); here?
There was a problem hiding this comment.
If they're both directly printing to stderr then it's fine. I've just been bitten by, e.g. mixing cerr and stderr because they have separate buffering.
19c7c72 to
dca0422
Compare
|
EWS run on current version of this PR (hash dca0422) Details |
https://bugs.webkit.org/show_bug.cgi?id=295101 rdar://154490712 Reviewed by Joshua Hoffman. After this commit, with a build of WebKit that has ENABLE(TREE_DEBUGGING), one can run: notifyutil -p com.apple.WebKit.showAccessibilityTree To dump the accessibility tree on-demand. Also, when ENABLE(INCLUDE_IGNORED_IN_CORE_AX_TREE), this commit changes streamAXCoreObject to print the parent object (including ignored), and streamSubtree to print ignored children. * Source/WebCore/accessibility/AXCoreObject.h: (WebCore::AXCoreObject::parentInCoreTree const): * Source/WebCore/accessibility/AXLogger.cpp: (WebCore::streamSubtree): * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::showAccessibilityTree): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::parentInCoreTree const): Deleted. * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNode): * Source/WebCore/page/cocoa/PageCocoa.mm: (WebCore::Page::platformInitialize): * Source/WebCore/rendering/RenderObject.cpp: (WebCore::printAccessibilityTreeForLiveDocuments): * Source/WebCore/rendering/RenderObject.h: * Source/WebKit/Resources/cocoa/NotificationAllowList/ForwardedNotifications.def: Canonical link: https://commits.webkit.org/296746@main
dca0422 to
3bcec6c
Compare
|
Committed 296746@main (3bcec6c): https://commits.webkit.org/296746@main Reviewed commits have been landed. Closing PR #47299 and removing active labels. |
3bcec6c
dca0422
🧪 api-gtk