[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 01:57:47 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=45889





--- Comment #21 from Ryosuke Niwa <rniwa at webkit.org>  2011-02-06 01:57:47 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.

>>> 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.

-- 
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