WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
Bug 81661
keypress event fired at <body> ends up adding text to a text field
https://bugs.webkit.org/show_bug.cgi?id=81661
Summary
keypress event fired at <body> ends up adding text to a text field
jochen
Reported
2012-03-20 07:01:37 PDT
Created
attachment 132820
[details]
layout test The attached layout tests demonstrates that a keypress event fired at body (or some other non-editable node for that matter) can end up editing another part of the node, if one of the event handlers changes the selection. I've tested this with Chrome, and Safari, both will insert "a" into the text field. Firefox does not, IE9 does enter it. It's not clear to me, what the expected behavior is? See also
bug 81660
Attachments
layout test
(752 bytes, patch)
2012-03-20 07:01 PDT
,
jochen
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2012-03-20 09:52:31 PDT
WebKit/IE behavior makes good sense to me.
jochen
Comment 2
2012-03-20 12:21:49 PDT
(In reply to
comment #1
)
> WebKit/IE behavior makes good sense to me.
what strikes me as strange is that the event target is the body element, while the text is inserted in the input field.
Ryosuke Niwa
Comment 3
2012-03-20 12:25:31 PDT
(In reply to
comment #2
)
> (In reply to
comment #1
) > > WebKit/IE behavior makes good sense to me. > > what strikes me as strange is that the event target is the body element, while the text is inserted in the input field.
But the focus is at the input element, right? The event target can't be changed once the event is dispatched, but the focus element can be changed after the fact.
jochen
Comment 4
2012-03-20 12:29:03 PDT
(In reply to
comment #3
)
> (In reply to
comment #2
) > > (In reply to
comment #1
) > > > WebKit/IE behavior makes good sense to me. > > > > what strikes me as strange is that the event target is the body element, while the text is inserted in the input field. > > But the focus is at the input element, right? The event target can't be changed once the event is dispatched, but the focus element can be changed after the fact.
yes
jochen
Comment 5
2012-03-30 01:27:29 PDT
Closing as invalid as this seems to be working as intended
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug