[Webkit-unassigned] [Bug 57723] Spinbuttons on [type="number"] etc. with [step="any"] do not work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 29 01:56:05 PDT 2011


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


Kent Tamura <tkent at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #99054|review?                     |review-
               Flag|                            |




--- Comment #4 from Kent Tamura <tkent at chromium.org>  2011-06-29 01:56:04 PST ---
(From update of attachment 99054)
View in context: https://bugs.webkit.org/attachment.cgi?id=99054&action=review

> Source/WebCore/ChangeLog:17
> +        * html/HTMLInputElement.cpp:
> +        (WebCore::HTMLInputElement::applyStep):
> +        (WebCore::HTMLInputElement::getAllowedValueStepWithDecimalPlacesWithAllowingStepAny):
> +        (WebCore::HTMLInputElement::stepUp):
> +        (WebCore::HTMLInputElement::stepDown):
> +        (WebCore::HTMLInputElement::stepUpFromRenderer):
> +        * html/HTMLInputElement.h:

You should write summaries of changes in each of files/functions.

> Source/WebCore/html/HTMLInputElement.cpp:380
> +void HTMLInputElement::applyStep(double count, bool allowsStepAny, ExceptionCode& ec)

Do not introduce bool parameter.  We prefer enum to bool strongly.
e.g.
enum AnyStepHandling { RejectAny, AnyIsDefaultStep };

> Source/WebCore/html/HTMLInputElement.cpp:443
> +    ASSERT(step);
> +    double defaultStep = m_inputType->defaultStep();
> +    double stepScaleFactor = m_inputType->stepScaleFactor();
> +    if (!isfinite(defaultStep) || !isfinite(stepScaleFactor))
> +        return false;

This part is duplicate with getAllowedValueStepWithDecimalPlaces().  It's not good.

The difference between this function and getAllowedValueStepWithDecimalPlaces() is only "any" handling. I think it's ok to add the enum parameter to getAllowedValueStepWithDecimalPlaces().

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