Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1410093006: Exempt about: URLs from self-reference check for nested frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/srcdoc/srcdoc-deep-nested-frames.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 IntRect rect = editor().firstRectForRange(nextCharacterRange); 747 IntRect rect = editor().firstRectForRange(nextCharacterRange);
748 if (rect.contains(framePoint)) 748 if (rect.contains(framePoint))
749 return EphemeralRange(nextCharacterRange); 749 return EphemeralRange(nextCharacterRange);
750 } 750 }
751 751
752 return EphemeralRange(); 752 return EphemeralRange();
753 } 753 }
754 754
755 bool LocalFrame::isURLAllowed(const KURL& url) const 755 bool LocalFrame::isURLAllowed(const KURL& url) const
756 { 756 {
757 // srcdoc is always allowed
758 if (equalIgnoringFragmentIdentifier(document()->completeURL(AtomicString("ab out:srcdoc")), url))
dcheng 2015/10/29 14:47:07 How about using Document::isSrcdocDocument() inste
759 return true;
760
757 // We allow one level of self-reference because some sites depend on that, 761 // We allow one level of self-reference because some sites depend on that,
758 // but we don't allow more than one. 762 // but we don't allow more than one.
759 bool foundSelfReference = false; 763 bool foundSelfReference = false;
760 for (const Frame* frame = this; frame; frame = frame->tree().parent()) { 764 for (const Frame* frame = this; frame; frame = frame->tree().parent()) {
761 if (!frame->isLocalFrame()) 765 if (!frame->isLocalFrame())
762 continue; 766 continue;
763 if (equalIgnoringFragmentIdentifier(toLocalFrame(frame)->document()->url (), url)) { 767 if (equalIgnoringFragmentIdentifier(toLocalFrame(frame)->document()->url (), url)) {
764 if (foundSelfReference) 768 if (foundSelfReference)
765 return false; 769 return false;
766 foundSelfReference = true; 770 foundSelfReference = true;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 if (!context) 907 if (!context)
904 return; 908 return;
905 909
906 WebSecurityOrigin securityOrigin(context->securityOrigin()); 910 WebSecurityOrigin securityOrigin(context->securityOrigin());
907 frameScheduler()->setFrameOrigin(&securityOrigin); 911 frameScheduler()->setFrameOrigin(&securityOrigin);
908 } 912 }
909 913
910 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); 914 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
911 915
912 } // namespace blink 916 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/srcdoc/srcdoc-deep-nested-frames.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698