WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
38434
Use HTML5 number parsing in HTMLProgressElement
https://bugs.webkit.org/show_bug.cgi?id=38434
Summary
Use HTML5 number parsing in HTMLProgressElement
Yael
Reported
2010-05-02 07:07:33 PDT
Suggested in
https://bugs.webkit.org/show_bug.cgi?id=38140#c12
and
https://bugs.webkit.org/show_bug.cgi?id=38140#c15
to use the more strict HTML5 parsing code.
Attachments
Patch
(6.70 KB, patch)
2010-05-02 07:21 PDT
,
Yael
darin
: review-
Details
Formatted Diff
Diff
Patch addressing comment #2.
(7.31 KB, patch)
2010-05-03 06:05 PDT
,
Yael
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Yael
Comment 1
2010-05-02 07:21:07 PDT
Created
attachment 54878
[details]
Patch
Darin Adler
Comment 2
2010-05-02 23:50:28 PDT
Comment on
attachment 54878
[details]
Patch
> + Use parseToDoubleForNumberType instead of toDouble.
Where are the tests for the behavior changes this creates? We require tests for any bug fixes. Or is this refactoring only?
> + Throw an exception when the number is NaN or Infinity.
All the test changes seem to be for this independent half of the patch.
> + if (isnan(value) || !isfinite(value)) {
The isnan check here is redundant and should be removed. The isfinite function returns false for NAN. review- because of a lack of test for the HTML5 number parsing change and because the extra check should be omitted.
Yael
Comment 3
2010-05-03 06:05:31 PDT
Created
attachment 54920
[details]
Patch addressing
comment #2
. Add more tests for parseToDoubleForNumberType and remove redundant isnan().
Darin Adler
Comment 4
2010-05-03 08:19:18 PDT
Comment on
attachment 54920
[details]
Patch addressing
comment #2
.
> +try { > p.value = "200A"; > -p.max = 100; > -shouldBe("p.value", "0"); > -shouldBe("p.max", "100"); > -shouldBe("p.position", "0"); > +} catch (e) { > +debug(e.message); > +}
The shouldThrow function is a cleaner way to do a test like this.
Yael
Comment 5
2010-05-03 11:21:42 PDT
Committed
r58687
: <
http://trac.webkit.org/changeset/58687
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug