[Webkit-unassigned] [Bug 89226] [GTK] Get rid of DumpRenderTreeSupportGtk::{in|de}crementAccessibilityValue

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


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


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #147841|review?                     |review+, commit-queue-
               Flag|                            |




--- Comment #2 from Martin Robinson <mrobinson at webkit.org>  2012-06-15 10:52:45 PST ---
(From update of attachment 147841)
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));

-- 
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