RESOLVED FIXED 43814
selectionStart clobbered if textarea isn't focused
https://bugs.webkit.org/show_bug.cgi?id=43814
Summary selectionStart clobbered if textarea isn't focused
Ojan Vafai
Reported 2010-08-10 14:58:51 PDT
Created attachment 64049 [details] test case See test case. IE/Gecko/Opera don't clobber.
Attachments
test case (400 bytes, text/html)
2010-08-10 14:58 PDT, Ojan Vafai
no flags
Patch (4.23 KB, patch)
2010-08-17 12:33 PDT, Ojan Vafai
tony: review+
Ojan Vafai
Comment 1 2010-08-10 15:01:19 PDT
Also, if you call editArea.focus() before setting selectionEnd in the test case, then selectionStart doesn't get clobbered.
Ojan Vafai
Comment 2 2010-08-17 12:33:07 PDT
Tony Chang
Comment 3 2010-08-17 13:32:10 PDT
Comment on attachment 64619 [details] Patch > diff --git a/LayoutTests/fast/forms/text-control-select-blurred.html b/LayoutTests/fast/forms/text-control-select-blurred.html Nit: Can you add some text explaining what this is testing? > diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp > void RenderTextControl::setSelectionStart(int start) > { > - setSelectionRange(start, max(start, selectionEnd())); > + HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*> (node()); Nit: kill the space between > and (? I don't see any other static_casts with this space.
Ojan Vafai
Comment 4 2010-08-17 15:34:10 PDT
Note You need to log in before you can comment on or make changes to this bug.