Index: Source/core/page/FocusController.cpp |
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp |
index 2f3173962b8c6d642cf89752a69ac69d50b2852b..43545931fb5b40824853c79e25541018579abfe3 100644 |
--- a/Source/core/page/FocusController.cpp |
+++ b/Source/core/page/FocusController.cpp |
@@ -304,6 +304,12 @@ Frame* FocusController::focusedOrMainFrame() const |
{ |
if (Frame* frame = focusedFrame()) |
return frame; |
+ |
+ for (Frame* frame = m_page->mainFrame()->tree().top(); frame; frame = frame->tree().traverseNext()) { |
dcheng
2014/07/16 21:09:08
Can we somehow annotate this as a horrible hack? P
kenrb
2014/07/17 14:57:02
I have added a comment. I don't think it is worth
|
+ if (frame->isLocalRoot()) |
+ return frame; |
+ } |
+ |
return m_page->mainFrame(); |
} |
@@ -730,7 +736,9 @@ void FocusController::setActive(bool active) |
view->updateControlTints(); |
} |
- toLocalFrame(focusedOrMainFrame())->selection().pageActivationChanged(); |
+ Frame* frame = focusedOrMainFrame(); |
+ if (frame->isLocalFrame()) |
+ toLocalFrame(frame)->selection().pageActivationChanged(); |
} |
static void updateFocusCandidateIfNeeded(FocusType type, const FocusCandidate& current, FocusCandidate& candidate, FocusCandidate& closest) |