[Webkit-unassigned] [Bug 15251] Setting input.value for <input type=range> does not update the position of the slider thumb if the thumb has been dragged once

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 21 12:28:13 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=15251





------- Comment #6 from aroben at apple.com  2007-09-21 12:28 PDT -------
Adele said she didn't think the approach in my first patch was right, so I
debugged a bit more, and I think I have found the real cause.

It looks as though the thumb's position will only get updated if
HTMLInputElement::setChanged() is called at some point. When setting the value
through JS, this happens in HTMLInputElement::parseMappedAttribute:

    } else if (attr->name() == valueAttr) {
        // We only need to setChanged if the form is looking at the default
value right now.
        if (m_value.isNull())
            setChanged();
        setValueMatchesRenderer(false);

Note the check for if (m_value.isNull()). Normally, modifications to m_value
only happen if HTMLInputElement::storesValueSeparateFromAttribute() returns
true (which it does not for <input type=range>). So for an <input type=range>,
we would expect m_value.isNull() to always be true, and therefore setChanged()
to always be called when input.value is modified.

However, there is one place where m_value is set without first checking
storesValueSeparateFromAttribute(): HTMLInputElement::setValueFromRenderer().
This method gets called from RenderSlider::setValueForPosition(), which is
called when you drag the thumb. This sets m_value, so setChanged() is never
subsequently called when input.value is set from JS.

It seems like RenderSlider really wants to set the value attribute directly,
not HTMLInputElement::m_value.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list