diff options
Diffstat (limited to 'WebCore/html/HTMLEmbedElement.cpp')
-rw-r--r-- | WebCore/html/HTMLEmbedElement.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/WebCore/html/HTMLEmbedElement.cpp b/WebCore/html/HTMLEmbedElement.cpp index e88ee81..c4f007c 100644 --- a/WebCore/html/HTMLEmbedElement.cpp +++ b/WebCore/html/HTMLEmbedElement.cpp @@ -25,13 +25,16 @@ #include "HTMLEmbedElement.h" #include "Attribute.h" -#include "CSSHelper.h" #include "CSSPropertyNames.h" +#include "DocumentLoader.h" #include "Frame.h" #include "HTMLDocument.h" #include "HTMLImageLoader.h" #include "HTMLNames.h" #include "HTMLObjectElement.h" +#include "HTMLParserIdioms.h" +#include "MainResourceLoader.h" +#include "PluginDocument.h" #include "RenderEmbeddedObject.h" #include "RenderImage.h" #include "RenderWidget.h" @@ -94,9 +97,9 @@ void HTMLEmbedElement::parseMappedAttribute(Attribute* attr) if (!isImageType() && m_imageLoader) m_imageLoader.clear(); } else if (attr->name() == codeAttr) - m_url = deprecatedParseURL(value.string()); + m_url = stripLeadingAndTrailingHTMLSpaces(value.string()); else if (attr->name() == srcAttr) { - m_url = deprecatedParseURL(value.string()); + m_url = stripLeadingAndTrailingHTMLSpaces(value.string()); if (renderer() && isImageType()) { if (!m_imageLoader) m_imageLoader = adoptPtr(new HTMLImageLoader(this)); @@ -158,8 +161,20 @@ void HTMLEmbedElement::updateWidget(bool onlyCreateNonNetscapePlugins) Vector<String> paramValues; parametersForPlugin(paramNames, paramValues); - if (!dispatchBeforeLoadEvent(m_url)) + ASSERT(!m_inBeforeLoadEventHandler); + m_inBeforeLoadEventHandler = true; + bool beforeLoadAllowedLoad = dispatchBeforeLoadEvent(m_url); + m_inBeforeLoadEventHandler = false; + + if (!beforeLoadAllowedLoad) { + if (document()->isPluginDocument()) { + // Plugins inside plugin documents load differently than other plugins. By the time + // we are here in a plugin document, the load of the plugin (which is the plugin document's + // main resource) has already started. We need to explicitly cancel the main resource load here. + toPluginDocument(document())->cancelManualPluginLoad(); + } return; + } SubframeLoader* loader = document()->frame()->loader()->subframeLoader(); // FIXME: beforeLoad could have detached the renderer! Just like in the <object> case above. @@ -177,7 +192,7 @@ bool HTMLEmbedElement::rendererIsNeeded(RenderStyle* style) // If my parent is an <object> and is not set to use fallback content, I // should be ignored and not get a renderer. - Node* p = parentNode(); + ContainerNode* p = parentNode(); if (p && p->hasTagName(objectTag)) { ASSERT(p->renderer()); if (!static_cast<HTMLObjectElement*>(p)->useFallbackContent()) { |