Bug 28913 - Programmatic focus transfer from an iframe to input type="text" unusable
Summary: Programmatic focus transfer from an iframe to input type="text" unusable
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 28908
  Show dependency treegraph
 
Reported: 2009-09-02 11:13 PDT by Alexander Pavlov (apavlov)
Modified: 2013-03-21 13:59 PDT (History)
1 user (show)

See Also:


Attachments
testcase for "partial" focus transfer (791 bytes, application/zip)
2009-09-02 11:13 PDT, Alexander Pavlov (apavlov)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2009-09-02 11:13:48 PDT
Created attachment 38933 [details]
testcase for "partial" focus transfer

When an input type="text" is added to the top-level document from an iframe element oncontextmenu handler and the input element is given focus as input.focus(), only regular alphanumeric keypresses (onkeypress handler?) events reach the input element. Space/arrows are captured by the iframe, which can be seen as iframe content scrolling.

Attached is a reduced testcase that exposes the bug.
A context menu (Ctrl-click) should be invoked on the "Click me to pop up" div to show the editbox with "partial" focus.
Comment 1 Alexey Proskuryakov 2009-09-04 13:50:41 PDT
Confirmed with r48070.

This is an interesting bug, but for the purposes of prioritization, does it affect any existing site, or does it have such potential? What's the use case for creating a text input from oncontextmenu?
Comment 2 Alexander Pavlov (apavlov) 2009-09-04 14:17:55 PDT
(In reply to comment #1)
> This is an interesting bug, but for the purposes of prioritization, does it
> affect any existing site, or does it have such potential? What's the use case
> for creating a text input from oncontextmenu?

I encountered it while implementing conditional breakpoints frontend (https://bugs.webkit.org/show_bug.cgi?id=28908) - a popup with the breakpoint condition editor is displayed instead of the context menu when a breakpoint is clicked in the source frame. The popup should be displayed in the top frame but I had to work this bug around and show it in the source iframe instead (which made the solution a bit heavier).
Sorry for not filling out the "Blocks" field initially.
Comment 3 Alexey Proskuryakov 2013-03-21 13:59:24 PDT
See also: bug 20387.