| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
| 6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
| 7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
| 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 void Frame::detachFromFrameHost() | 176 void Frame::detachFromFrameHost() |
| 177 { | 177 { |
| 178 m_host = 0; | 178 m_host = 0; |
| 179 } | 179 } |
| 180 | 180 |
| 181 bool Frame::isMainFrame() const | 181 bool Frame::isMainFrame() const |
| 182 { | 182 { |
| 183 Page* page = this->page(); | 183 Page* page = this->page(); |
| 184 return page && this == page->mainFrame(); | 184 return (page && this == page->mainFrame()) || isLocalRoot(); |
| 185 } |
| 186 |
| 187 bool Frame::isLocalRoot() const { |
| 188 if (isRemoteFrame()) |
| 189 return false; |
| 190 |
| 191 if (!tree().parent()) |
| 192 return true; |
| 193 |
| 194 return tree().parent()->isRemoteFrame(); |
| 185 } | 195 } |
| 186 | 196 |
| 187 void Frame::disconnectOwnerElement() | 197 void Frame::disconnectOwnerElement() |
| 188 { | 198 { |
| 189 if (m_owner) { | 199 if (m_owner) { |
| 190 if (m_owner->isLocal()) | 200 if (m_owner->isLocal()) |
| 191 toHTMLFrameOwnerElement(m_owner)->clearContentFrame(); | 201 toHTMLFrameOwnerElement(m_owner)->clearContentFrame(); |
| 192 if (page()) | 202 if (page()) |
| 193 page()->decrementSubframeCount(); | 203 page()->decrementSubframeCount(); |
| 194 } | 204 } |
| 195 m_owner = 0; | 205 m_owner = 0; |
| 196 } | 206 } |
| 197 | 207 |
| 198 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const | 208 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const |
| 199 { | 209 { |
| 200 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; | 210 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; |
| 201 } | 211 } |
| 202 | 212 |
| 203 } // namespace WebCore | 213 } // namespace WebCore |
| OLD | NEW |