[webkit-reviews] review granted: [Bug 36259] <input type=range> does not validate correctly without a renderer and the tests are incorrect : [Attachment 51082] [PATCH] Part 1 - Refactor: Move SliderRange out and rename to StepRange
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 18 18:50:32 PDT 2010
David Kilzer (ddkilzer) <ddkilzer at webkit.org> has granted Joseph Pecoraro
<joepeck at webkit.org>'s request for review:
Bug 36259: <input type=range> does not validate correctly without a renderer
and the tests are incorrect
https://bugs.webkit.org/show_bug.cgi?id=36259
Attachment 51082: [PATCH] Part 1 - Refactor: Move SliderRange out and rename to
StepRange
https://bugs.webkit.org/attachment.cgi?id=51082&action=review
------- Additional Comments from David Kilzer (ddkilzer) <ddkilzer at webkit.org>
> diff --git a/WebCore/html/StepRange.cpp b/WebCore/html/StepRange.cpp
> new file mode 100644
> index 0000000..78f0365
> --- /dev/null
> +++ b/WebCore/html/StepRange.cpp
> @@ -0,0 +1,80 @@
> +/*
> + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
Nit: Update copyright to include 2010.
> +double sliderPosition(HTMLInputElement* element)
> +{
> + StepRange range(element);
> + return range.proportionFromValue(range.valueFromElement(element));
> +}
I think this method should remain in RenderSlider.cpp. It's of no use outside
that class.
> diff --git a/WebCore/html/StepRange.h b/WebCore/html/StepRange.h
> new file mode 100644
> index 0000000..7b2388e
> --- /dev/null
> +++ b/WebCore/html/StepRange.h
> @@ -0,0 +1,60 @@
> +/*
> + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
Nit: Update copyright to include 2010.
> +struct StepRange {
Just make it a class. I don't see an advantage to leaving it a struct.
I would also inherit from non-copyable to make it explicit that we don't
support copying these objects.
> + double valueFromElement(HTMLInputElement*, bool* wasClamped = 0);
Again, I think this method should stay in RenderSlider.cpp as a static method.
+++ b/WebCore/rendering/RenderSlider.cpp
Update the copyright here, too. :)
r=me with the above changes.
More information about the webkit-reviews
mailing list