Bug 17193 - Attributes of <input type=range> not accessable from javascript
: Attributes of <input type=range> not accessable from javascript
Status: NEW
Product: WebKit
Classification: Unclassified
Component: HTML DOM
: 523.x (Safari 3)
: All All
: P2 Normal
Assigned To: Nobody
: HasReduction
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-06 04:50 PST by Sascha
Modified: 2010-03-17 17:54 PDT (History)
4 users (show)

See Also:


Attachments
test of min/max attributes of <input type=range> element (734 bytes, text/html)
2008-02-06 04:52 PST, Sascha
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha 2008-02-06 04:50:35 PST
The min and max attributes of the <input type=range> element can not read from a javascript.
Make somthing like this:        a = input_el.min;         it only return "undefined"

I have this tested and confirmed on 10.4.11 Safari3, Win XP Safari3beta and Win XP Safari3beta +Nightly r29908

I think internaly it is used because if youset the element's value to a out-of-bound the value is set to the min/max boundary.
Comment 1 Sascha 2008-02-06 04:52:35 PST
Created attachment 18959 [details]
test of min/max attributes of <input type=range> element
Comment 2 Sascha 2008-02-06 05:12:43 PST
Additional Info:
This problem also leads to a not functionality in Safaris RSS viewer. If you cklick the images on left/right of the scale slider result in no reaction.
I have made a little patch on my own Safari (windows) and it works. I only add a test if the attribute is set
or initalize it with it boundaries.
File: Articles.js
Location on Windows: Safari/PubSub.resources/Articles.js
Patch:
1171,1172d1170
<     if (slider.min == undefined)
<         slider.min = 0;
1177,1178d1174
<     if (slider.max == undefined)
<         slider.max = 100;
Comment 3 Alexey Proskuryakov 2008-02-06 05:41:35 PST
Why is this a bug? HTMLInputElement interface definition does not specify that these attributes should be available as properties AFAICT.

One can use getAttribute() and related DOM methods to manipulate element attributes.
Comment 4 Alexey Proskuryakov 2008-02-06 05:52:49 PST
(In reply to comment #2)
> This problem also leads to a not functionality in Safaris RSS viewer.

Thank you! Filed as <rdar://problem/5727306>.
Comment 5 David Kilzer (:ddkilzer) 2008-07-22 14:11:42 PDT
Web Forms 2.0 doesn't mention anything about including "min" and "max" as DOM attributes:

http://www.whatwg.org/specs/web-forms/current-work/#ranges
Comment 6 Joseph Pecoraro 2010-03-17 17:54:09 PDT
This now works correctly if you have explicitly provided min/max attribute values. However, it doesn't seem to work with the defaults, which are 0 and 100 for an <input type=range>. I am going to leave this open for that reason.