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 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 bool HTMLAppletElement::layoutObjectIsNeeded(const ComputedStyle& style) | 86 bool HTMLAppletElement::layoutObjectIsNeeded(const ComputedStyle& style) |
87 { | 87 { |
88 if (!fastHasAttribute(codeAttr) && !openShadowRoot()) | 88 if (!fastHasAttribute(codeAttr) && !openShadowRoot()) |
89 return false; | 89 return false; |
90 return HTMLPlugInElement::layoutObjectIsNeeded(style); | 90 return HTMLPlugInElement::layoutObjectIsNeeded(style); |
91 } | 91 } |
92 | 92 |
93 LayoutObject* HTMLAppletElement::createLayoutObject(const ComputedStyle& style) | 93 LayoutObject* HTMLAppletElement::createLayoutObject(const ComputedStyle& style) |
94 { | 94 { |
95 if (!canEmbedJava() || openShadowRoot()) | 95 return LayoutObject::createObject(this, style); |
96 return LayoutObject::createObject(this, style); | |
97 | |
98 if (usePlaceholderContent()) | |
99 return new LayoutBlockFlow(this); | |
100 | |
101 return new LayoutApplet(this); | |
102 } | 96 } |
103 | 97 |
104 LayoutPart* HTMLAppletElement::layoutPartForJSBindings() const | 98 LayoutPart* HTMLAppletElement::layoutPartForJSBindings() const |
105 { | 99 { |
106 if (!canEmbedJava()) | 100 return nullptr; |
107 return nullptr; | |
108 return HTMLPlugInElement::layoutPartForJSBindings(); | |
109 } | 101 } |
110 | 102 |
111 LayoutPart* HTMLAppletElement::existingLayoutPart() const | 103 LayoutPart* HTMLAppletElement::existingLayoutPart() const |
112 { | 104 { |
113 return layoutPart(); | 105 return layoutPart(); |
114 } | 106 } |
115 | 107 |
116 void HTMLAppletElement::updateWidgetInternal() | 108 void HTMLAppletElement::updateWidgetInternal() |
117 { | 109 { |
118 setNeedsWidgetUpdate(false); | 110 setNeedsWidgetUpdate(false); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 setPlaceholder(nullptr); | 194 setPlaceholder(nullptr); |
203 } else if (placeholder) { | 195 } else if (placeholder) { |
204 setPlaceholder(placeholder.release()); | 196 setPlaceholder(placeholder.release()); |
205 } else if (widget) { | 197 } else if (widget) { |
206 document().setContainsPlugins(); | 198 document().setContainsPlugins(); |
207 setWidget(widget); | 199 setWidget(widget); |
208 setPlaceholder(nullptr); | 200 setPlaceholder(nullptr); |
209 } | 201 } |
210 } | 202 } |
211 | 203 |
212 bool HTMLAppletElement::canEmbedJava() const | |
213 { | |
214 if (document().isSandboxed(SandboxPlugins)) | |
215 return false; | |
216 | |
217 Settings* settings = document().settings(); | |
218 if (!settings) | |
219 return false; | |
220 | |
221 if (!settings->javaEnabled()) | |
222 return false; | |
223 | |
224 return true; | |
225 } | |
226 | |
227 bool HTMLAppletElement::canEmbedURL(const KURL& url) const | 204 bool HTMLAppletElement::canEmbedURL(const KURL& url) const |
228 { | 205 { |
229 if (!document().securityOrigin()->canDisplay(url)) { | 206 if (!document().securityOrigin()->canDisplay(url)) { |
230 FrameLoader::reportLocalLoadFailed(document().frame(), url.string()); | 207 FrameLoader::reportLocalLoadFailed(document().frame(), url.string()); |
231 return false; | 208 return false; |
232 } | 209 } |
233 | 210 |
234 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) | 211 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) |
235 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), m_serviceType, m_serviceType, url)) { | 212 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), m_serviceType, m_serviceType, url)) { |
236 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje
ct::PluginBlockedByContentSecurityPolicy); | 213 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje
ct::PluginBlockedByContentSecurityPolicy); |
237 return false; | 214 return false; |
238 } | 215 } |
239 return true; | 216 return true; |
240 } | 217 } |
241 | 218 |
242 } | 219 } |
OLD | NEW |