Index: WebCore/html/HTMLFrameElementBase.cpp |
=================================================================== |
--- WebCore/html/HTMLFrameElementBase.cpp (revision 48064) |
+++ WebCore/html/HTMLFrameElementBase.cpp (working copy) |
@@ -242,8 +242,12 @@ |
void HTMLFrameElementBase::setFocus(bool received) |
{ |
HTMLFrameOwnerElement::setFocus(received); |
- if (Page* page = document()->page()) |
- page->focusController()->setFocusedFrame(received ? contentFrame() : 0); |
+ if (Page* page = document()->page()) { |
+ if (received) |
+ page->focusController()->setFocusedFrame(contentFrame()); |
+ else if (page->focusController()->focusedFrame() == contentFrame()) // Focus may have already been given to another frame, don't take it away. |
+ page->focusController()->setFocusedFrame(0); |
+ } |
} |
bool HTMLFrameElementBase::isURLAttribute(Attribute *attr) const |