Bug 262356 - AX: Add debug description method for accessibility objects
Summary: AX: Add debug description method for accessibility objects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-28 22:13 PDT by Tyler Wilcock
Modified: 2023-09-29 12:53 PDT (History)
10 users (show)

See Also:


Attachments
Patch (4.51 KB, patch)
2023-09-28 23:06 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].