| 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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 const EphemeralRange nextCharacterRange = makeRange(position, next); | 787 const EphemeralRange nextCharacterRange = makeRange(position, next); |
| 788 if (nextCharacterRange.isNotNull()) { | 788 if (nextCharacterRange.isNotNull()) { |
| 789 IntRect rect = editor().firstRectForRange(nextCharacterRange); | 789 IntRect rect = editor().firstRectForRange(nextCharacterRange); |
| 790 if (rect.contains(framePoint)) | 790 if (rect.contains(framePoint)) |
| 791 return EphemeralRange(nextCharacterRange); | 791 return EphemeralRange(nextCharacterRange); |
| 792 } | 792 } |
| 793 | 793 |
| 794 return EphemeralRange(); | 794 return EphemeralRange(); |
| 795 } | 795 } |
| 796 | 796 |
| 797 bool LocalFrame::isURLAllowed(const KURL& url) const { | |
| 798 // Exempt about: URLs from self-reference check. | |
| 799 if (url.protocolIsAbout()) | |
| 800 return true; | |
| 801 | |
| 802 // We allow one level of self-reference because some sites depend on that, | |
| 803 // but we don't allow more than one. | |
| 804 bool foundSelfReference = false; | |
| 805 for (const Frame* frame = this; frame; frame = frame->tree().parent()) { | |
| 806 if (!frame->isLocalFrame()) | |
| 807 continue; | |
| 808 if (equalIgnoringFragmentIdentifier(toLocalFrame(frame)->document()->url(), | |
| 809 url)) { | |
| 810 if (foundSelfReference) | |
| 811 return false; | |
| 812 foundSelfReference = true; | |
| 813 } | |
| 814 } | |
| 815 return true; | |
| 816 } | |
| 817 | |
| 818 bool LocalFrame::shouldReuseDefaultView(const KURL& url) const { | 797 bool LocalFrame::shouldReuseDefaultView(const KURL& url) const { |
| 819 // Secure transitions can only happen when navigating from the initial empty | 798 // Secure transitions can only happen when navigating from the initial empty |
| 820 // document. | 799 // document. |
| 821 if (!loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 800 if (!loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
| 822 return false; | 801 return false; |
| 823 | 802 |
| 824 return document()->isSecureTransitionTo(url); | 803 return document()->isSecureTransitionTo(url); |
| 825 } | 804 } |
| 826 | 805 |
| 827 void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) { | 806 void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 906 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 928 m_frame->client()->frameBlameContext()->Enter(); | 907 m_frame->client()->frameBlameContext()->Enter(); |
| 929 } | 908 } |
| 930 | 909 |
| 931 ScopedFrameBlamer::~ScopedFrameBlamer() { | 910 ScopedFrameBlamer::~ScopedFrameBlamer() { |
| 932 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 911 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 933 m_frame->client()->frameBlameContext()->Leave(); | 912 m_frame->client()->frameBlameContext()->Leave(); |
| 934 } | 913 } |
| 935 | 914 |
| 936 } // namespace blink | 915 } // namespace blink |
| OLD | NEW |