<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>16990</bug_id>
          
          <creation_ts>2008-01-23 16:45:43 -0800</creation_ts>
          <short_desc>Setting value attribute on an &lt;input type=range&gt; to an out-of-range value fires oninput</short_desc>
          <delta_ts>2010-03-19 09:46:46 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>36259</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>adele</cc>
    
    <cc>arv</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>joepeck</cc>
    
    <cc>tkent</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68078</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-23 16:45:43 -0800</bug_when>
    <thetext>Setting the value attribute on an &lt;input type=range&gt; to an out-of-range value fires oninput. According to Web Forms &lt;http://www.whatwg.org/specs/web-forms/current-work/#the-change&gt;:

&gt; [The input] event must be fired on a control whenever the value of the control changes due to input from the user

which sounds like we should not be firing this event in this case, since it&apos;s not due to input from the user.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68079</commentid>
    <comment_count>1</comment_count>
      <attachid>18630</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-23 16:46:00 -0800</bug_when>
    <thetext>Created attachment 18630
testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68080</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-23 16:46:43 -0800</bug_when>
    <thetext>&lt;rdar://problem/5703512&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68081</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-23 16:51:52 -0800</bug_when>
    <thetext>It seems strange to me that RenderSlider is doing bounds checking at all. I&apos;d expect HTMLInputElement to take care of all of that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201038</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-03-17 16:47:41 -0700</bug_when>
    <thetext>I was looking at refactoring some of this code, the fact that RenderSlider does the bounds checking has more far reaching affects. For instance in one of the LayoutTests:

  LayoutTest/fast/forms/script-tests/ValidityState-rangeOverflow.js

An &lt;input&gt; element is created but not added to the page, thus has no renderer, and the deferred RenderSlider bounds checking never gets reached.  Modifying the test to append the input to the document.body enables the renderer code path and tests start to fail! I&apos;ll see if I can make sense of what the real test values should be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201044</commentid>
    <comment_count>5</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-03-17 16:58:03 -0700</bug_when>
    <thetext>History shows a few FIXMEs in the area and a mention of a potential problem in the ChangeLog:
http://trac.webkit.org/changeset/41972

&gt; (WebCore::RenderSlider::updateFromElement): Added code to immediately update the value 
&gt; in the element if it&apos;s out of range. This clamping used to be done as a side effect of 
&gt; setPositionFromValue. Also, this has nothing to do with the renderer, so at some point 
&gt; it could be moved into HTMLInputElement.

Tests were added later when other input types were added, so I think the range input values were assumed to be correct at that time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201104</commentid>
    <comment_count>6</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-03-17 18:22:47 -0700</bug_when>
    <thetext>I believe this is related to:
https://bugs.webkit.org/show_bug.cgi?id=36259</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201901</commentid>
    <comment_count>7</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-03-19 09:46:46 -0700</bug_when>
    <thetext>Corrected by other change.
New test was added for this:

  LayoutTests/fast/forms/range-input-dynamic-oninput-expected.txt
  LayoutTests/fast/forms/range-input-dynamic-oninput.html


Committed r56242
	M	WebCore/ChangeLog
	M	WebCore/html/StepRange.h
	M	WebCore/html/HTMLInputElement.cpp
	M	WebCore/html/StepRange.cpp
	M	WebCore/rendering/RenderSlider.cpp
	M	LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt
	M	LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js
	M	LayoutTests/fast/forms/script-tests/validationMessage.js
	M	LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js
	M	LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
	M	LayoutTests/fast/forms/range-reset.html
	A	LayoutTests/fast/forms/range-input-dynamic-oninput-expected.txt
	A	LayoutTests/fast/forms/range-input-dynamic-oninput.html
	M	LayoutTests/fast/forms/ValidityState-rangeUnderflow-expected.txt
	M	LayoutTests/fast/forms/validationMessage-expected.txt
	M	LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
	M	LayoutTests/fast/forms/range-reset-expected.txt
	M	LayoutTests/ChangeLog
r56242 = 1569c5e33346f0e1681d92a925be02480504e8d5 (trunk)
http://trac.webkit.org/changeset/56242</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>18630</attachid>
            <date>2008-01-23 16:46:00 -0800</date>
            <delta_ts>2008-01-23 16:46:00 -0800</delta_ts>
            <desc>testcase</desc>
            <filename>slider-value-oninput.html</filename>
            <type>text/html</type>
            <size>500</size>
            <attacher name="Adam Roben (:aroben)">aroben</attacher>
            
              <data encoding="base64">PHNjcmlwdD4KdmFyIHZhbCA9IDU7CmZ1bmN0aW9uIGxvZyhtc2cpIHsgZG9jdW1lbnQuZ2V0RWxl
bWVudEJ5SWQoJ2xvZycpLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKG1zZyAr
ICdcbicpKTsgfQpmdW5jdGlvbiB0ZXN0KCkgeyBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFt
ZSgnaW5wdXQnKVswXS52YWx1ZSA9IDIwMDsgfQo8L3NjcmlwdD4KPHA+VGhpcyBwYWdlIHRlc3Rz
IHRoYXQgc2V0dGluZyB0aGUgdmFsdWUgb2YgYW4gPHR0PiZsdDtpbnB1dCB0eXBlPXJhbmdlJmd0
OzwvdHQ+IGVsZW1lbnQgdG8gYW4gb3V0LW9mLXJhbmdlIHZhbHVlIGRvZXMgbm90IGZpcmUgdGhl
IDx0dD5vbmlucHV0PC90dD4gZXZlbnQuPC9wPgo8aW5wdXQgdHlwZT1yYW5nZSBvbmlucHV0PSJs
b2coJ0ZBSUwnKSIgbWluPTAgbWF4PTEwMCB2YWx1ZT01MD4KPGJ1dHRvbiBvbmNsaWNrPSJ0ZXN0
KCkiPkNsaWNrIG1lITwvYnV0dG9uPgo8cHJlIGlkPSJsb2ciPjwvcHJlPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>