Index: Source/core/html/HTMLAppletElement.cpp |
diff --git a/Source/core/html/HTMLAppletElement.cpp b/Source/core/html/HTMLAppletElement.cpp |
index 7d63cb481e1399544cc7281ab0f3b4d452369053..af9de0c88e87fca22ffd82d0d6118bbd4bc7fb16 100644 |
--- a/Source/core/html/HTMLAppletElement.cpp |
+++ b/Source/core/html/HTMLAppletElement.cpp |
@@ -92,12 +92,20 @@ |
LayoutObject* HTMLAppletElement::createLayoutObject(const ComputedStyle& style) |
{ |
- return LayoutObject::createObject(this, style); |
+ if (!canEmbedJava() || openShadowRoot()) |
+ return LayoutObject::createObject(this, style); |
+ |
+ if (usePlaceholderContent()) |
+ return new LayoutBlockFlow(this); |
+ |
+ return new LayoutApplet(this); |
} |
LayoutPart* HTMLAppletElement::layoutPartForJSBindings() const |
{ |
- return nullptr; |
+ if (!canEmbedJava()) |
+ return nullptr; |
+ return HTMLPlugInElement::layoutPartForJSBindings(); |
} |
LayoutPart* HTMLAppletElement::existingLayoutPart() const |
@@ -201,6 +209,21 @@ |
} |
} |
+bool HTMLAppletElement::canEmbedJava() const |
+{ |
+ if (document().isSandboxed(SandboxPlugins)) |
+ return false; |
+ |
+ Settings* settings = document().settings(); |
+ if (!settings) |
+ return false; |
+ |
+ if (!settings->javaEnabled()) |
+ return false; |
+ |
+ return true; |
+} |
+ |
bool HTMLAppletElement::canEmbedURL(const KURL& url) const |
{ |
if (!document().securityOrigin()->canDisplay(url)) { |