Bug 28913

Summary: Programmatic focus transfer from an iframe to input type="text" unusable
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 28908    
Attachments:
Description Flags
testcase for "partial" focus transfer none

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.