| Index: Source/core/frame/LocalDOMWindow.cpp
|
| diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
|
| index 926de144193cf533bef0b4ef1472bf2137363d95..a8c7f5c59251eedb3712d86b8bbe7b854872f388 100644
|
| --- a/Source/core/frame/LocalDOMWindow.cpp
|
| +++ b/Source/core/frame/LocalDOMWindow.cpp
|
| @@ -976,21 +976,20 @@ void LocalDOMWindow::focus(ExecutionContext* context)
|
| if (!host)
|
| return;
|
|
|
| - bool allowFocus = WindowFocusAllowedIndicator::windowFocusAllowed();
|
| - if (context) {
|
| + ASSERT(context);
|
| +
|
| + bool allowFocus = context->isWindowFocusAllowed();
|
| + if (allowFocus) {
|
| + context->consumeWindowFocus();
|
| + } else {
|
| ASSERT(isMainThread());
|
| - Document* activeDocument = toDocument(context);
|
| - if (opener() && opener() != this && activeDocument->domWindow() == opener())
|
| - allowFocus = true;
|
| + allowFocus = opener() && (opener() != this) && (toDocument(context)->domWindow() == opener());
|
| }
|
|
|
| // If we're a top level window, bring the window to the front.
|
| if (frame()->isMainFrame() && allowFocus)
|
| host->chrome().focus();
|
|
|
| - if (!frame())
|
| - return;
|
| -
|
| frame()->eventHandler().focusDocumentView();
|
| }
|
|
|
|
|