Bug 64858 - input[type='number'] with step="any" suffers from step mismatch.
Summary: input[type='number'] with step="any" suffers from step mismatch.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 03:34 PDT by Shinya Kawanaka
Modified: 2011-07-21 20:27 PDT (History)
1 user (show)

See Also:


Attachments
Patch (7.87 KB, patch)
2011-07-20 03:39 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (8.89 KB, patch)
2011-07-21 19:38 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2011-07-20 03:34:49 PDT
This bug is related to https://bugs.webkit.org/show_bug.cgi?id=57723

For this input:
<input min="0" max="100" step="any" value="1.5">
stepping up from renderer makes the value 3.0. I think this should be 2.5.
The input with step="any" should not suffer from step mismatch.
Comment 1 Shinya Kawanaka 2011-07-20 03:39:23 PDT
Created attachment 101446 [details]
Patch
Comment 2 Kent Tamura 2011-07-20 04:02:59 PDT
Comment on attachment 101446 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101446&action=review

> Source/WebCore/html/HTMLInputElement.cpp:429
> +    // If step is not "any", the value should by aligned to the step.
> +    const AtomicString& stepString = fastGetAttribute(stepAttr);
> +    if (!equalIgnoringCase(stepString, "any")) {

This comment is not helpful. We avoid comments about "what we do here".  This comment should be removed.
Also, this comment has a typo; by -> be.

In this case, you might want to make a function named alignValueForStep(...) for readability.
Comment 3 Shinya Kawanaka 2011-07-21 19:38:47 PDT
Created attachment 101690 [details]
Patch
Comment 4 Kent Tamura 2011-07-21 20:04:48 PDT
Comment on attachment 101690 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101690&action=review

ok.

> Source/WebCore/html/HTMLInputElement.cpp:428
> +    const AtomicString& stepString = fastGetAttribute(stepAttr);
> +    if (!equalIgnoringCase(stepString, "any"))

nit: The variable 'stepString' is not needed.
Comment 5 WebKit Review Bot 2011-07-21 20:27:43 PDT
Comment on attachment 101690 [details]
Patch

Clearing flags on attachment: 101690

Committed r91549: <http://trac.webkit.org/changeset/91549>
Comment 6 WebKit Review Bot 2011-07-21 20:27:47 PDT
All reviewed patches have been landed.  Closing bug.