Bug 262356

Summary: AX: Add debug description method for accessibility objects
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Tyler Wilcock 2023-09-28 22:13:02 PDT
...
Comment 1 Radar WebKit Bug Importer 2023-09-28 22:13:20 PDT
<rdar://problem/116220179>
Comment 2 Tyler Wilcock 2023-09-28 23:06:53 PDT
Created attachment 467972 [details]
Patch
Comment 3 chris fleizach 2023-09-28 23:24:37 PDT
Comment on attachment 467972 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=467972&action=review

> Source/WebCore/accessibility/AccessibilityObject.cpp:115
> +String AccessibilityObject::dbg() const

can we give this a proper name? or is this standard throughout webkit?

in Cocoa it would be ::description()
Comment 4 Tyler Wilcock 2023-09-28 23:33:50 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 467972 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=467972&action=review
> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:115
> > +String AccessibilityObject::dbg() const
> 
> can we give this a proper name? or is this standard throughout webkit?
> 
> in Cocoa it would be ::description()
I think the standard name in WebKit is "debugDescription". But that's way more characters than dbg(), and I'm typing this very very often, and Xcode doesn't autocomplete C++ (at least in WebKit). So I recognize this goes against the style guide, but maybe that's OK for a function of this purpose? What do y'all think?
Comment 5 chris fleizach 2023-09-28 23:41:34 PDT
Comment on attachment 467972 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=467972&action=review

>>> Source/WebCore/accessibility/AccessibilityObject.cpp:115
>>> +String AccessibilityObject::dbg() const
>> 
>> can we give this a proper name? or is this standard throughout webkit?
>> 
>> in Cocoa it would be ::description()
> 
> I think the standard name in WebKit is "debugDescription". But that's way more characters than dbg(), and I'm typing this very very often, and Xcode doesn't autocomplete C++ (at least in WebKit). So I recognize this goes against the style guide, but maybe that's OK for a function of this purpose? What do y'all think?

your reasoning makes sense

should we wrap this in #if !NDEBUG
Comment 6 Tyler Wilcock 2023-09-28 23:44:44 PDT
(In reply to chris fleizach from comment #5)
> Comment on attachment 467972 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=467972&action=review
> 
> >>> Source/WebCore/accessibility/AccessibilityObject.cpp:115
> >>> +String AccessibilityObject::dbg() const
> >> 
> >> can we give this a proper name? or is this standard throughout webkit?
> >> 
> >> in Cocoa it would be ::description()
> > 
> > I think the standard name in WebKit is "debugDescription". But that's way more characters than dbg(), and I'm typing this very very often, and Xcode doesn't autocomplete C++ (at least in WebKit). So I recognize this goes against the style guide, but maybe that's OK for a function of this purpose? What do y'all think?
> 
> your reasoning makes sense
> 
> should we wrap this in #if !NDEBUG
It would be nice to have this method available in release, too, for times when debug builds are too slow. This also matches Node::debugDescription and RenderObject::debugDescription which are not guarded by !NDEBUG.
Comment 7 EWS 2023-09-29 12:53:51 PDT
Committed 268666@main (613ac6287437): <https://commits.webkit.org/268666@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 467972 [details].