[Webkit-unassigned] [Bug 45889] Style visibility: hidden on <br/> tags causes input fields to lose focus after deleting all content
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Feb 6 09:53:35 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=45889
--- Comment #23 from Srikumar B <srikumar.b at gmail.com> 2011-02-06 09:53:35 PST ---
(From update of attachment 80639)
View in context: https://bugs.webkit.org/attachment.cgi?id=80639&action=review
>>>> Source/WebCore/editing/DeleteSelectionCommand.cpp:753
>>>> + }
>>>
>>> Why do we care that the input field is focused?
>>
>> The text is being deleted in this validation.
>> So i have added the flag isFocusedNodeTextInputElement required to be set only when the input text field is focused and characters in the input field are being deleted which can be used in the below condition to make sure placeholder is needed or not. Hence we will call createBreakElement().
>>
>> Please share me if you have any further comments on this.
>
> So are you saying that we can insert br into a text field if it's not focused? I'm skeptical about that. I don't think we should ever insert a br into the shadow DOM of an input element.
The actual issue is, When you click on text field==>enter text=> delete complete text==>Now, I cannot enter text as i am not able to edit the focusing node==> Even i cannot gain the cursor by clicking on the text field==> Now if i click outside the textfield with mouse and click on text field again, i Can enter the text. So the issue is that, till the focus is on text field and while editing the text only. When the focus is lost and gain back, There is no issue. I have attached the issue test page (45889_issue.htm). Kindly try to reproduce the issue. Do let me know your comment.
>>>> LayoutTests/editing/deleting/textfield-loose-focus-with-br.html:27
>>>> +document.write(document.getElementById("t").value == "XYZ" ? "PASS" : "FAIL");
>>>
>>> Wait, this doesn't test what the test claims to test. Shouldn't we be testing that t is still focused?
>>
>> Without these code changes, after "Delete", i am unable to insert any characters even though focus ring is still on text field as hidden style of BR does not let enter data.
>> hence the test is failing because document.execCommand("InsertText",false,'XYZ') statement fails.
>>
>> With this fix, the cursor still remain on input text field and document.execCommand("InsertText",false,'XYZ') succeed.
>>
>> Do let me know your comments on it.
>
> I think you should still check that t has focus because that's the bug is about. You can check both that has focus and you can successfully insert text.
Sure. I will test both conditions. Could you please let me know how to validate the focus is on text field? Is it document.activeElement or any better way to get the focus node which is editable or not?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list