Chromium Code Reviews| 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |