| Index: Source/core/frame/LocalDOMWindow.cpp
|
| ===================================================================
|
| --- Source/core/frame/LocalDOMWindow.cpp (revision 187183)
|
| +++ Source/core/frame/LocalDOMWindow.cpp (working copy)
|
| @@ -976,14 +976,12 @@
|
| if (!host)
|
| return;
|
|
|
| - ASSERT(context);
|
| -
|
| - bool allowFocus = context->isWindowFocusAllowed();
|
| - if (allowFocus) {
|
| - context->consumeWindowFocus();
|
| - } else {
|
| + bool allowFocus = WindowFocusAllowedIndicator::windowFocusAllowed();
|
| + if (context) {
|
| ASSERT(isMainThread());
|
| - allowFocus = opener() && (opener() != this) && (toDocument(context)->domWindow() == opener());
|
| + Document* activeDocument = toDocument(context);
|
| + if (opener() && opener() != this && activeDocument->domWindow() == opener())
|
| + allowFocus = true;
|
| }
|
|
|
| // If we're a top level window, bring the window to the front.
|
| @@ -990,6 +988,9 @@
|
| if (frame()->isMainFrame() && allowFocus)
|
| host->chrome().focus();
|
|
|
| + if (!frame())
|
| + return;
|
| +
|
| frame()->eventHandler().focusDocumentView();
|
| }
|
|
|
|
|