[Webkit-unassigned] [Bug 87077] New: [Forms][Meter][Progress] Change function signature of parseToDoubleForNumberType
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 21 20:54:10 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=87077
Summary: [Forms][Meter][Progress] Change function signature of
parseToDoubleForNumberType
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Forms
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: yosin at chromium.org
Blocks: 80009
This proposal is for
* reducing number of lines in call sites for ease of maintenance,
* be functional style (no side effect and increasing chance to use floating pointer register)
== Current Pattern 1 ==
double numberValue;
if (!parseToDoubleForNumberType(string, &numberValue))
return defaultValue;
ASSERT(isfinite(numberValue));
return numberValue;
== New Pattern 1 ==
return parseToDoubleForNumberType(string, defaultValue)
== Current Pattern 2 ==
double max;
bool ok = parseToDoubleForNumberType(string, &max);
if (!ok || max <= 0)
return 1;
return max;
== New Pattern 2 ==
return max(parseToDoubleForNumberType(string), 1);
== Current Pattern 3 ==
return !value.isEmpty() && !parseToDoubleForNumberType(value, 0);
== New Pattern 3 ==
return !value.isEmpty() && isfinite(parseToDubleForNumberType(value));
== Current Pattern 4 ==
double min = 0;
parseToDoubleForNumberType(string, &min);
return min;
== New Pattern 4 ==
return parseToDoubleForNumberType(string, 0);
--
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