| Index: Source/core/frame/DOMWindow.cpp
|
| diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
|
| index 15a499eed8652e0d313279030c78d9f2f4ba5fc9..53b60ef7dea67c43e15c5054eae95668b55946a5 100644
|
| --- a/Source/core/frame/DOMWindow.cpp
|
| +++ b/Source/core/frame/DOMWindow.cpp
|
| @@ -238,10 +238,7 @@ static bool allowsBeforeUnloadListeners(DOMWindow* window)
|
| Frame* frame = window->frame();
|
| if (!frame)
|
| return false;
|
| - Page* page = frame->page();
|
| - if (!page)
|
| - return false;
|
| - return frame == page->mainFrame();
|
| + return frame->isMainFrame();
|
| }
|
|
|
| unsigned DOMWindow::pendingUnloadEventListeners() const
|
| @@ -403,7 +400,7 @@ PassRefPtr<Document> DOMWindow::installNewDocument(const String& mimeType, const
|
|
|
| m_frame->selection().updateSecureKeyboardEntryIfActive();
|
|
|
| - if (m_frame->page() && m_frame->page()->mainFrame() == m_frame) {
|
| + if (m_frame->isMainFrame()) {
|
| m_frame->page()->mainFrame()->notifyChromeClientWheelEventHandlerCountChanged();
|
| if (m_document->hasTouchEventHandlers())
|
| m_frame->page()->chrome().client().needTouchEvents(true);
|
| @@ -943,7 +940,7 @@ void DOMWindow::focus(ExecutionContext* context)
|
| }
|
|
|
| // If we're a top level window, bring the window to the front.
|
| - if (m_frame == page->mainFrame() && allowFocus)
|
| + if (m_frame->isMainFrame() && allowFocus)
|
| page->chrome().focus();
|
|
|
| if (!m_frame)
|
|
|