[Webkit-unassigned] [Bug 60871] HTML5 Number Spinbox displays a 0 in situations where a 0 is not between the min and max.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 16 17:44:29 PDT 2011


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





--- Comment #9 from Naoki Takano <takano.naoki at gmail.com>  2011-05-16 17:44:29 PST ---
(In reply to comment #8)
> (From update of attachment 93620 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=93620&action=review
> 
> > LayoutTests/fast/forms/numeric-input-spin.html:48
> > +//     - The value should be the minimum value for both keyDown and keyUp.
> 
> Don't call them keydown / keyup.  Keydown and keyup are the names of DOM events.
Ok, anyway the test is consolidated to the test you suggested;-)

> 
> > Source/WebCore/html/HTMLInputElement.cpp:1466
> > +        int nextDiff = step * n;
> > +        if (current < m_inputType->minimum() - nextDiff)
> > +            current = m_inputType->minimum() - nextDiff;
> 
> This looks tricky.  But I understand you want to use the following step-rounding and the event dispatching.  So I think this is acceptable.
Thanks,

> 
> > Source/WebCore/html/HTMLInputElement.cpp:1475
> > -        if (stepMismatch(currentStringValue)) {
> > +        if (stepMismatch(value())) {
> 
> Instead of this change, we had better do currentStringValue=value() just after setValueAsNumber().
> Anyway, this also fixes another bug http://crbug.com/76046 , right?
I didn't know the bug. But fortunately, the bug is gone after the change.

My original intention is to fix this one
//   * If 0 is in-range, but not matched to step value
//     - The value should be the larger matched value nearest to 0 if n > 0   //       e.g. <input type=number min=-100 step=3> -> 2               

Should I separate the bug entry?


Also I suppose 
> > +        if (stepMismatch(value())) {
Is better than currentStringValue=value().

Because after this step, the following steps are executed,
if (currentStringValue != value()) {
    if (m_inputType->isRangeControl())
            dispatchFormControlChangeEvent();
        else
            dispatchFormControlInputEvent();
}

So shouldn't we change currentStringValue, right?

What do you think?

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