| 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 | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 9 * rights reserved. | 9 * rights reserved. |
| 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 const EphemeralRange nextCharacterRange = makeRange(position, next); | 803 const EphemeralRange nextCharacterRange = makeRange(position, next); |
| 804 if (nextCharacterRange.isNotNull()) { | 804 if (nextCharacterRange.isNotNull()) { |
| 805 IntRect rect = editor().firstRectForRange(nextCharacterRange); | 805 IntRect rect = editor().firstRectForRange(nextCharacterRange); |
| 806 if (rect.contains(framePoint)) | 806 if (rect.contains(framePoint)) |
| 807 return EphemeralRange(nextCharacterRange); | 807 return EphemeralRange(nextCharacterRange); |
| 808 } | 808 } |
| 809 | 809 |
| 810 return EphemeralRange(); | 810 return EphemeralRange(); |
| 811 } | 811 } |
| 812 | 812 |
| 813 bool LocalFrame::isURLAllowed(const KURL& url) const { | |
| 814 // Exempt about: URLs from self-reference check. | |
| 815 if (url.protocolIsAbout()) | |
| 816 return true; | |
| 817 | |
| 818 // We allow one level of self-reference because some sites depend on that, | |
| 819 // but we don't allow more than one. | |
| 820 bool foundSelfReference = false; | |
| 821 for (const Frame* frame = this; frame; frame = frame->tree().parent()) { | |
| 822 if (!frame->isLocalFrame()) | |
| 823 continue; | |
| 824 if (equalIgnoringFragmentIdentifier(toLocalFrame(frame)->document()->url(), | |
| 825 url)) { | |
| 826 if (foundSelfReference) | |
| 827 return false; | |
| 828 foundSelfReference = true; | |
| 829 } | |
| 830 } | |
| 831 return true; | |
| 832 } | |
| 833 | |
| 834 bool LocalFrame::shouldReuseDefaultView(const KURL& url) const { | 813 bool LocalFrame::shouldReuseDefaultView(const KURL& url) const { |
| 835 // Secure transitions can only happen when navigating from the initial empty | 814 // Secure transitions can only happen when navigating from the initial empty |
| 836 // document. | 815 // document. |
| 837 if (!loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 816 if (!loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
| 838 return false; | 817 return false; |
| 839 | 818 |
| 840 return document()->isSecureTransitionTo(url); | 819 return document()->isSecureTransitionTo(url); |
| 841 } | 820 } |
| 842 | 821 |
| 843 void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) { | 822 void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 922 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 944 m_frame->client()->frameBlameContext()->Enter(); | 923 m_frame->client()->frameBlameContext()->Enter(); |
| 945 } | 924 } |
| 946 | 925 |
| 947 ScopedFrameBlamer::~ScopedFrameBlamer() { | 926 ScopedFrameBlamer::~ScopedFrameBlamer() { |
| 948 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 927 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 949 m_frame->client()->frameBlameContext()->Leave(); | 928 m_frame->client()->frameBlameContext()->Leave(); |
| 950 } | 929 } |
| 951 | 930 |
| 952 } // namespace blink | 931 } // namespace blink |
| OLD | NEW |