[Webkit-unassigned] [Bug 118966] [ATK] Implement allAttributes() for AccessibilityUIElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 29 10:13:45 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=118966





--- Comment #5 from Mario Sanchez Prada <mario at webkit.org>  2013-07-29 10:13:25 PST ---
Thanks for the review, Gustavo. See some comments below...

(In reply to comment #4)
> (From update of attachment 207521 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=207521&action=review
> 
> > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:76
> > +    GString* str = g_string_new(0);
> 
> Might be worth it taking advantage of the change to use StringBuilder and String here =)

Sure. Changed.

> > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:241
> > +        if (parentName && g_utf8_strlen(parentName, -1)) {
> > +            attributeLine.set(g_strdup_printf(": %s", parentName));
> > +
> > +        }
> 
> No need for braces, empty line

Ok.

> > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:257
> > +        attributeLine.set(g_strdup_printf("%s\n", title.utf8().data()));
> 
> How about using String::format("%s\n", title.utf8().data())? Then you can have attributeLine live on the stack and avoid dealing with char pointers.

Ok. Changed the patch to do that.

> > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:303
> > +    // We append the ATK specific attributes as a single line at the end.
> > +    GOwnPtr<char> attributeData(getAtkAttributeSetAsString(element->platformUIElement()));
> > +    attributeLine.set(g_strdup_printf("AXPlatformAttributes: %s", attributeData.get()));
> > +    builder.append(attributeLine.get());
> 
> Ditto.

Done.

> > Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:493
> > -    String roleString = roleToString(role);
> > -    return JSStringCreateWithUTF8CString(roleString.utf8().data());
> > +    GOwnPtr<char> roleStringWithPrefix(g_strdup_printf("AXRole: %s", roleToString(role)));
> > +    return JSStringCreateWithUTF8CString(roleStringWithPrefix.get());
> 
> Ditto.

Done.

> > Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:292
> > +    attributeLine.set(g_strdup_printf("%s\n", element->role()->string().utf8().data()));
> > +    builder.append(attributeLine.get());
> 
> This file also has a number of potential changes from char* to String.

I agree with that, but that's probably something better to tackle in different patches.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list