Summary: | Use HTML5 number parsing in HTMLProgressElement | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yael <yael> | ||||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | ||||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Yael
2010-05-02 07:07:33 PDT
Created attachment 54878 [details]
Patch
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. Created attachment 54920 [details] Patch addressing comment #2. Add more tests for parseToDoubleForNumberType and remove redundant isnan(). 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. Committed r58687: <http://trac.webkit.org/changeset/58687> |