Bug 55861 - IFrame is getting the focus even though it is hidden
Summary: IFrame is getting the focus even though it is hidden
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Erik Arvidsson
Keywords: HasReduction
Depends on:
Reported: 2011-03-07 01:15 PST by satya
Modified: 2011-04-10 22:42 PDT (History)
6 users (show)

See Also:

Hidden frame getting the focus (660 bytes, application/octet-stream)
2011-03-07 01:15 PST, satya
no flags Details
Simpler test case (360 bytes, text/html)
2011-04-05 11:03 PDT, Erik Arvidsson
no flags Details
Patch (4.28 KB, patch)
2011-04-05 12:37 PDT, Erik Arvidsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description satya 2011-03-07 01:15:53 PST
Created attachment 84925 [details]
Hidden frame getting the focus

I have used an Iframe, which will is hidden ie style="display:none". But when I am using the tab to move the focus to next control, the hidden frame is getting the focus. So, I need to tab again to get the focus on the element. If I have more hidden IFrames, then almost it behaves like the focus was lost.

Please use the attached files to reproduce the issues.
Steps to reproduce:
1. Unzip the attachment
2. Make sure the src of the IFrame in the focusTest.htm is hiddenpage.htm
3. Open the page focusTest.htm
4. Put the focus on first input and use tab to move the focus.
5. Second input will get the focus but the third input input will not get the focus. Extra tab is required to get the focus on it.

It was working fine all other browsers.
Comment 1 Mattias Nissler 2011-04-05 02:17:07 PDT
Confirmed on chrome 12 dev:

Google Chrome	12.0.712.0 (Official Build 79102) dev
WebKit	534.27 (trunk@81703)
User Agent	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.27 (KHTML, like Gecko) Chrome/12.0.712.0 Safari/534.27
Command Line	 /opt/google/chrome/google-chrome --user-data-dir=/home/mnissler/.config/chrome_chromium --flag-switches-begin --flag-switches-end
Comment 2 Mattias Nissler 2011-04-05 02:19:34 PDT
Note that this also affects the case when an iframe gets hidden while an element within that iframe is focused, at which point the focused element should lose focus, but doesn't.
Comment 3 Erik Arvidsson 2011-04-05 11:03:56 PDT
Created attachment 88280 [details]
Simpler test case
Comment 4 Erik Arvidsson 2011-04-05 12:37:49 PDT
Created attachment 88294 [details]
Comment 5 Erik Arvidsson 2011-04-08 12:33:22 PDT
Adding some reviewers...
Comment 6 Dimitri Glazkov (Google) 2011-04-08 12:57:58 PDT
Comment on attachment 88294 [details]

ooh, this is good.
Comment 7 WebKit Commit Bot 2011-04-08 16:37:50 PDT
Comment on attachment 88294 [details]

Clearing flags on attachment: 88294

Committed r83356: <http://trac.webkit.org/changeset/83356>
Comment 8 WebKit Commit Bot 2011-04-08 16:37:55 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 satya 2011-04-10 22:42:55 PDT
In which chrome and safari version we can get the fix available???