OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) | 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "CSSHelper.h" | 27 #include "CSSHelper.h" |
28 #include "Document.h" | 28 #include "Document.h" |
29 #include "EventNames.h" | 29 #include "EventNames.h" |
30 #include "FocusController.h" | 30 #include "FocusController.h" |
31 #include "Frame.h" | 31 #include "Frame.h" |
32 #include "FrameLoader.h" | 32 #include "FrameLoader.h" |
33 #include "FrameTree.h" | 33 #include "FrameTree.h" |
34 #include "FrameView.h" | 34 #include "FrameView.h" |
35 #include "HTMLFrameSetElement.h" | 35 #include "HTMLFrameSetElement.h" |
36 #include "HTMLNames.h" | 36 #include "HTMLNames.h" |
| 37 #include "ScriptController.h" |
37 #include "ScriptEventListener.h" | 38 #include "ScriptEventListener.h" |
38 #include "KURL.h" | 39 #include "KURL.h" |
39 #include "MappedAttribute.h" | 40 #include "MappedAttribute.h" |
40 #include "Page.h" | 41 #include "Page.h" |
41 #include "RenderFrame.h" | 42 #include "RenderFrame.h" |
42 #include "Settings.h" | 43 #include "Settings.h" |
43 | 44 |
44 namespace WebCore { | 45 namespace WebCore { |
45 | 46 |
46 using namespace HTMLNames; | 47 using namespace HTMLNames; |
(...skipping 10 matching lines...) Expand all Loading... |
57 { | 58 { |
58 } | 59 } |
59 | 60 |
60 bool HTMLFrameElementBase::isURLAllowed() const | 61 bool HTMLFrameElementBase::isURLAllowed() const |
61 { | 62 { |
62 if (m_URL.isEmpty()) | 63 if (m_URL.isEmpty()) |
63 return true; | 64 return true; |
64 | 65 |
65 const KURL& completeURL = document()->completeURL(m_URL); | 66 const KURL& completeURL = document()->completeURL(m_URL); |
66 | 67 |
| 68 if (protocolIsJavaScript(completeURL)) { |
| 69 Document* contentDoc = this->contentDocument(); |
| 70 if (contentDoc && !ScriptController::canAccessFromCurrentOrigin(contentD
oc->frame())) |
| 71 return false; |
| 72 } |
| 73 |
67 // Don't allow more than 200 total frames in a set. This seems | 74 // Don't allow more than 200 total frames in a set. This seems |
68 // like a reasonable upper bound, and otherwise mutually recursive | 75 // like a reasonable upper bound, and otherwise mutually recursive |
69 // frameset pages can quickly bring the program to its knees with | 76 // frameset pages can quickly bring the program to its knees with |
70 // exponential growth in the number of frames. | 77 // exponential growth in the number of frames. |
71 // FIXME: This limit could be higher, but because WebKit has some | 78 // FIXME: This limit could be higher, but because WebKit has some |
72 // algorithms that happen while loading which appear to be N^2 or | 79 // algorithms that happen while loading which appear to be N^2 or |
73 // worse in the number of frames, we'll keep it at 200 for now. | 80 // worse in the number of frames, we'll keep it at 200 for now. |
74 if (Frame* parentFrame = document()->frame()) { | 81 if (Frame* parentFrame = document()->frame()) { |
75 if (parentFrame->page()->frameCount() > 200) | 82 if (parentFrame->page()->frameCount() > 200) |
76 return false; | 83 return false; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 303 |
297 void HTMLFrameElementBase::willRemove() | 304 void HTMLFrameElementBase::willRemove() |
298 { | 305 { |
299 if (m_remainsAliveOnRemovalFromTree) | 306 if (m_remainsAliveOnRemovalFromTree) |
300 return; | 307 return; |
301 | 308 |
302 HTMLFrameOwnerElement::willRemove(); | 309 HTMLFrameOwnerElement::willRemove(); |
303 } | 310 } |
304 | 311 |
305 } // namespace WebCore | 312 } // namespace WebCore |
OLD | NEW |