Bug 17670 - Key events may improperly propagate from iframe to parent frame
Summary: Key events may improperly propagate from iframe to parent frame
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-04 11:26 PST by Rob Brackett
Modified: 2008-03-23 03:49 PDT (History)
1 user (show)

See Also:


Attachments
Iframe keyup event test case (2.15 KB, application/x-gzip)
2008-03-04 15:27 PST, Rob Brackett
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Brackett 2008-03-04 11:26:46 PST
A keyup event (but not keydown or keypress) generated inside an iframe can be captured on the document that contains the iframe, even though this shouldn't be possible.

This can be tested by creating a page with an iframe and adding a keyup event listener to the page's document and the iframe's document. If you give an element in the containing document focus and press a key, the document's keyup listener will fire. If you give an element in the iframe focus and press a key, both the iframe document's keyup listener AND the containing window document's keyup listener will fire.

Note: I have observed this on Mac OS X 10.4 and 10.5 on both PPC and Intel. The bug does NOT appear on Windows Vista. I have not tested Windows XP.
Comment 1 Alexey Proskuryakov 2008-03-04 13:25:18 PST
Thank you for the report!

Sounds like you already have a test case - could you please attach it (or link to it), so that we don't have to duplicate the effort?
Comment 2 Rob Brackett 2008-03-04 15:27:07 PST
Created attachment 19531 [details]
Iframe keyup event test case

Here's a test case for it -- there are three files, just open index.html. It demonstrates the problem with one iframe that is in the html, one that is added via javascript, and one that has designmode on.
Comment 3 Alexey Proskuryakov 2008-03-05 01:17:57 PST
Confirmed with r30791, nice test case.
Comment 4 Oliver Hunt 2008-03-23 00:21:58 PDT
This does effect other key events as well, although in a somewhat round about method.
Comment 5 Oliver Hunt 2008-03-23 03:49:48 PDT
Fix landed r31236