[webkit-reviews] review granted: [Bug 89226] [GTK] Get rid of DumpRenderTreeSupportGtk::{in|de}crementAccessibilityValue : [Attachment 147841] Patch proposal

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 15 10:52:45 PDT 2012


Martin Robinson <mrobinson at webkit.org> has granted Mario Sanchez Prada
<msanchez at igalia.com>'s request for review:
Bug 89226: [GTK] Get rid of
DumpRenderTreeSupportGtk::{in|de}crementAccessibilityValue
https://bugs.webkit.org/show_bug.cgi?id=89226

Attachment 147841: Patch proposal
https://bugs.webkit.org/attachment.cgi?id=147841&action=review

------- Additional Comments from Martin Robinson <mrobinson at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=147841&action=review


> Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceValue.cpp:78
> +    double minValue = coreObject->minValueForRange();
> +    newValue = newValue < minValue ? minValue : newValue;
> +
> +    double maxValue = coreObject->maxValueForRange();
> +    newValue = newValue > maxValue ? maxValue : newValue;

This can simply be: 
newValue = std::max(coreObject->minValueForRange(), newValue);
newValue = std::min(coreObject->maxValueForRange(), newValue);

> Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:649
> +static void alterCurrentValue(PlatformUIElement element, bool isIncrement)

Instead of a boolean it would make sense to either pass a sign value ala
alterCurrentValue(element, -1) and  alterCurrentValue(element, 1) or create an
enum AlterCurrentValueOperation { Increment, Decrement };

The nice thing about the sign approach is that below you can just write:

double newDoubleValue = g_value_get_double(&currentValue) + (sign *
g_value_get_double(&increment));


More information about the webkit-reviews mailing list