Bug 130575 - [ATK] Utilize new AtkValue interface coming in ATK 2.11.92
Summary: [ATK] Utilize new AtkValue interface coming in ATK 2.11.92
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Linux
: P2 Normal
Assignee: Krzysztof Czech
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-03-21 03:24 PDT by Krzysztof Czech
Modified: 2014-03-26 03:17 PDT (History)
10 users (show)

See Also:


Attachments
patch (16.49 KB, patch)
2014-03-24 10:05 PDT, Krzysztof Czech
mario: review+
Details | Formatted Diff | Diff
attempt to check bots (17.19 KB, patch)
2014-03-25 08:15 PDT, Krzysztof Czech
no flags Details | Formatted Diff | Diff
attempt to check bots (17.30 KB, patch)
2014-03-25 09:59 PDT, Krzysztof Czech
no flags Details | Formatted Diff | Diff
attempt to check efl bots. (17.30 KB, patch)
2014-03-26 01:53 PDT, Krzysztof Czech
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Czech 2014-03-21 03:24:20 PDT
ATK 2.11.92 introduces some new API and deprecates an old one. It adds AtkRange data type which I guess it could be used to squeeze some properties of a range controls into one. New API coming to get range value with its alternative description so I guess one may be used to get aria-valuenow and aria-valuetext and there are couple of more cool features.
Comment 1 Radar WebKit Bug Importer 2014-03-21 03:24:30 PDT
<rdar://problem/16389406>
Comment 2 Krzysztof Czech 2014-03-24 10:05:39 PDT
Created attachment 227663 [details]
patch
Comment 3 Mario Sanchez Prada 2014-03-25 06:39:38 PDT
Comment on attachment 227663 [details]
patch

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

Thanks for helping reduce the gap with latest ATK in WebKit! This patch looks good to me, I would just ask you to change a couple of things before landing (see them below)

> Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceValue.cpp:48
> +    gdouble value;

This is an internal variable so it can be a double

> Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceValue.cpp:78
> +    if (AccessibilityObject* coreObject = core(value)) {
> +        if (currentValue)
> +            *currentValue = coreObject->valueForRange();
> +        if (alternativeText)
> +            *alternativeText = g_strdup_printf("%s", coreObject->valueDescription().utf8().data());
> +    }

Could you switch this to an early return on !coreObject?

> Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceValue.cpp:88
> +    if (AccessibilityObject* coreObject = core(value))
> +        return webkitAccessibleGetIncrementValue(coreObject);
> +    return 0;

Ditto

> Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceValue.cpp:110
> +    if (AccessibilityObject* coreObject = core(value)) {
> +        gdouble minValue = coreObject->minValueForRange();
> +        gdouble maxValue = coreObject->maxValueForRange();
> +        gchar* valueDescription = g_strdup_printf("%s", coreObject->valueDescription().utf8().data());
> +        return atk_range_new(minValue, maxValue, valueDescription);
> +    }
> +    return nullptr;

Ditto

> Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:561
> +    if (AtkRange* range = atk_value_get_range(value)) {
> +        double value = isMinValue ? atk_range_get_lower_limit(range) : atk_range_get_upper_limit(range);
> +        atk_range_free(range);
> +        return value;
> +    }
> +    return 0;

Ditto

> Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:606
> +static double rangeMinMaxValue(AtkValue* value, bool isMinValue)

I don't like much bool parameters for these kind of uses. Would you mind defining a enum type instead and use that insteadl? Perhaps something such as enum RangeLimit { RangeLimitMinimum, RangeLimitMaximum } or the like.

> Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:613
> +    if (AtkRange* range = atk_value_get_range(value)) {
> +        double value = isMinValue ? atk_range_get_lower_limit(range) : atk_range_get_upper_limit(range);
> +        atk_range_free(range);
> +        return value;
> +    }
> +    return 0;

Ditto
Comment 4 Krzysztof Czech 2014-03-25 08:15:53 PDT
Created attachment 227751 [details]
attempt to check bots
Comment 5 Krzysztof Czech 2014-03-25 08:17:32 PDT
Applied all Mario's suggestions.
Waiting whether bots are green.
Comment 6 Krzysztof Czech 2014-03-25 09:59:45 PDT
Created attachment 227764 [details]
attempt to check bots
Comment 7 Krzysztof Czech 2014-03-26 01:53:08 PDT
Created attachment 227836 [details]
attempt to check efl bots.
Comment 8 WebKit Commit Bot 2014-03-26 03:17:13 PDT
Comment on attachment 227836 [details]
attempt to check efl bots.

Clearing flags on attachment: 227836

Committed r166288: <http://trac.webkit.org/changeset/166288>
Comment 9 WebKit Commit Bot 2014-03-26 03:17:18 PDT
All reviewed patches have been landed.  Closing bug.