Bug 99985 - [GTK] Don't use deprecated AccessibilityObject methods after r99502
Summary: [GTK] Don't use deprecated AccessibilityObject methods after r99502
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2012-10-22 05:44 PDT by Mario Sanchez Prada
Modified: 2012-10-22 10:33 PDT (History)
7 users (show)

See Also:


Attachments
Patch proposal (12.81 KB, patch)
2012-10-22 05:57 PDT, Mario Sanchez Prada
cfleizach: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2012-10-22 05:44:00 PDT
After fixing bug 99502, the following functions from AccessibilityObject got deprecated:

    virtual String accessibilityDescription() const { return String(); }
    virtual String title() const { return String(); }
    virtual String helpText() const { return String(); }

They should be replaced in the ATK wrapper with code using the new AccessibilityText based API.
Comment 1 Mario Sanchez Prada 2012-10-22 05:57:27 PDT
Created attachment 169888 [details]
Patch proposal
Comment 2 chris fleizach 2012-10-22 09:09:05 PDT
Comment on attachment 169888 [details]
Patch proposal

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

just one inline question...
I think changes look good for the first pass to ensure compatibility. Going forward GTK will probably want to adapt to provide better behavior and a way to expose aria-help, aria-describedby, summary and a few other types of text

> Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp:102
> +        return String();

this snippet is a Mac concept. Just want to make sure it also applies to GTK
Comment 3 Dominic Mazzoni 2012-10-22 09:50:25 PDT
Comment on attachment 169888 [details]
Patch proposal

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

> Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp:125
> +        // probably be in the description field since it's not "visible".

This also sounds Mac-specific. Does ATK have the similar rule?

On Mac, the basic rule seems to be:
* Title = whatever's visible, unless overridden
* Description = alternate text

On Windows, the basic rule would be described as:
* Name = primary title
* Description = secondary title

I thought ATK was more similar to Windows in this regard.

The implementation I'm planning for Chromium (Win and hopefully ATK) is simpler - just take the first valid string for the name, second valid string for the description.

Of course, that's likely to break some tests. That's why I'd like to see a test helper function that's cross-platform rather than testing title/description as if they were cross-platform when in reality they differ.
Comment 4 Mario Sanchez Prada 2012-10-22 10:28:22 PDT
Thanks both for the review and comments.

(In reply to comment #2)
> [...]
> just one inline question...
> I think changes look good for the first pass to ensure compatibility.
> Going forward GTK will probably want to adapt to provide better behavior
> and a way to expose aria-help, aria-describedby, summary and a few other
> types of text

Yes, that's the idea: to stop using that old API for the moment, to later on make the most of it to more accurately assign the accessible name and description for each element.

> > Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp:102
> > +        return String();
> 
> this snippet is a Mac concept. Just want to make sure it also applies to GTK

Good point. Actually, I think we can safely remove that since in ATK an object with StaticTextRole won't ever be exposed on its own, but by means of its parent accessibility object, wrapped by an object implementing AtkText.

Will remove that before landing (keeps passing tests).

(In reply to comment #3)
> (From update of attachment 169888 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169888&action=review
> 
> > Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp:125
> > +        // probably be in the description field since it's not "visible".
> 
> This also sounds Mac-specific. Does ATK have the similar rule?

I think for the particular case of images the same rule apply here. Thus, I would leave it as is now, and we could always fix it later if we need it.
 
> On Mac, the basic rule seems to be:
> * Title = whatever's visible, unless overridden
> * Description = alternate text
> 
> On Windows, the basic rule would be described as:
> * Name = primary title
> * Description = secondary title
> 
> I thought ATK was more similar to Windows in this regard.

I also think ATK leans more towards Windows than to mac in this regard, still not being exactly the same thing. Joanie can probably drop some more light on this regard, as she surely will know better.

> The implementation I'm planning for Chromium (Win and hopefully ATK) is 
> simpler - just take the first valid string for the name, second valid string 
> for the description.
> 
> Of course, that's likely to break some tests. That's why I'd like to see
> a test helper function that's cross-platform rather than testing
> title/description as if they were cross-platform when in reality they differ.

Makes sense, although I'm not completely sure that approach will always work anyway. Will probably need to keep some "special cases" for ATK, I'm afraid.
Comment 5 Mario Sanchez Prada 2012-10-22 10:33:06 PDT
Committed r132091: <http://trac.webkit.org/changeset/132091>